TFPreTrainedModel.prepare_tf_dataset() gives ImportError: Datasets module not found; but it is installed and usable (load_dataset() works)
See original GitHub issueSystem Info
Google Colab CPU Instance
transformers
version: 4.23.1- Platform: Linux-5.10.133±x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.15
- Huggingface_hub version: 0.10.1
- PyTorch version (GPU?): 1.12.1+cu113 (False)
- Tensorflow version (GPU?): 2.9.2 (False)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: Yes (However, the issue occurs even when not using parallel setup)
Who can help?
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
I was trying to follow along this nb from the notebooks repo This is the Colab link of my attempt, with the outputs (and the error)
Expected behavior
Detect that the Datasets package is present and use it as required.
Maybe there’s a really silly mistake I’m making but I really cannot figure out what it could be and I couldn’t find any similar results online.
Thanks in advance!
Issue Analytics
- State:
- Created a year ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
ImportError: No module named 'tensorflow_datasets ... - GitHub
I have installed rocm and rocm suppoted tensor flow, Observed the below error Traceback (most recent call last): File ".
Read more >ImportError: No module named datasets - Stack Overflow
when i am writing this in python sript. import tensorflow as tf from datasets import dataset_utils slim = tf.contrib.slim. But i ...
Read more >Fix ModuleNotFoundError No Module Named Tensorflow ...
... No Module Named Tensorflow Python Import Error ( If Installed / If ... pip2 list and pip3 list to find out which...
Read more >datasets.load — datasets 1.0.2 documentation - Hugging Face
Version]``): if specified, the module will be loaded from the datasets ... for DownloadConfig() which will override the attributes in download_config if ......
Read more >Why am I getting ImportError: No module named tensorflow?
In the above image, this error is occuring because I am not in the correct Python virtual environment. Notice The words “Python 3”...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Wait, this is just me being stupid. This is caused by us caching
_datasets_available
inimport_utils
. As a result, this will always happen if you import and use transformers classes before youpip install datasets
because this will cache a value ofFalse
until you restart your runtime. There’s no bug to fix here intransformers
- @swap-10 you just need to installdatasets
before importingtransformers
!Closing this issue now that we’ve added the user warnings about restarting the runtime