question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: Task image-classification is not compatible with this dataset! Available tasks: []

See original GitHub issue

System Info

Dear all,

Thank you for your great work. I have tried to run image-classification example on my simple dataset and I got this error. The version of transformers I used is the newest one. Do you have any idea what happened?

Thanks very much!

WARNING:datasets.builder:Found cached dataset imagefolder (/root/.cache/huggingface/datasets/imagefolder/default-9107176dcf18ce11/0.0.0/e872d3ec27c6c200a8881a4af52930df7eca3372b19aa4d0f5db74a2fded8141)
100% 1/1 [00:00<00:00, 45.80it/s]
Traceback (most recent call last):
  File "run_image_classification.py", line 388, in <module>
    main()
  File "run_image_classification.py", line 240, in main
    task="image-classification",
  File "/usr/local/lib/python3.7/dist-packages/datasets/load.py", line 1713, in load_dataset
    ds = ds.prepare_for_task(task)
  File "/usr/local/lib/python3.7/dist-packages/datasets/dataset_dict.py", line 1272, in prepare_for_task
    return DatasetDict({k: dataset.prepare_for_task(task=task, id=id) for k, dataset in self.items()})
  File "/usr/local/lib/python3.7/dist-packages/datasets/dataset_dict.py", line 1272, in <dictcomp>
    return DatasetDict({k: dataset.prepare_for_task(task=task, id=id) for k, dataset in self.items()})
  File "/usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py", line 2172, in prepare_for_task
    f"Task {task} is not compatible with this dataset! Available tasks: {list(unique_values(tasks))}"
ValueError: Task image-classification is not compatible with this dataset! Available tasks: []

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, …)
  • My own task or dataset (give details below)

Reproduction

!CUDA_DIVISIBLE_DEVICES=0, python3 run_image_classification.py
–model_name_or_path facebook/convnext-tiny-224
–train_dir $TRAIN_DIR
–output_dir $OUTPUT_DIR
–do_train
–do_eval
–learning_rate 1e-5
–num_train_epochs 10
–per_device_train_batch_size 16
–per_device_eval_batch_size 16
–logging_strategy steps
–logging_steps 10
–evaluation_strategy epoch
–save_strategy epoch
–load_best_model_at_end True
–save_total_limit 3
–seed 1337
–overwrite_output_dir

Expected behavior

ValueError: Task image-classification is not compatible with this dataset! Available tasks: []

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lhoestqcommented, Oct 5, 2022

I don’t think so, but the list is available here: https://github.com/huggingface/hub-docs/blob/main/js/src/lib/interfaces/Types.ts

Anyway for the next release I think we need to still have the known_task_ids variable, otherwise it makes evaluate crash.

Do you think you could fix this on the evaluate side and do a release ? Otherwise we can also re-add this list temporarily

1reaction
mariosaskocommented, Oct 4, 2022

Hi! We still need to make a patch release on the datasets side for my fix to take effect. In the meantime, you can install datasets directly from main:

pip install git+https://github.com/huggingface/datasets.git
Read more comments on GitHub >

github_iconTop Results From Across the Web

Main classes - Hugging Face
DatasetInfo documents datasets, including its name, version, and features. See the constructor arguments and properties for a full list. Note: Not all ......
Read more >
Training an object detection model using Hugging Face
This blog post will look at how we can train an object detection model using the Hugging Face transformers and datasets libraries. What...
Read more >
Source code for autogluon.vision.detector.detector
"""Object Detection task""" import copy import pickle import platform ... as they alter many of the same arguments and are not compatible with...
Read more >
How to Train an Object Detection Model with Keras
As such, we will use the dataset to learn a kangaroo object detection task, and ignore the masks and not focus on the...
Read more >
MSINT - Image classification - value error incompatible shape
I am beginning with image classification using keras. Tried a simple minst dataset for detecting numbers in images. Ran the model.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found