Models: ImportError: No module named 'tensorflow_datasets'

Created on 25 Apr 2019  Â·  10Comments  Â·  Source: tensorflow/models

I have installed rocm and rocm suppoted tensor flow, Observed the below error

Traceback (most recent call last):
File "./cifar10_train.py", line 44, in
import cifar10
File "/root/models/tutorials/image/cifar10/cifar10.py", line 42, in
import cifar10_input
File "/root/models/tutorials/image/cifar10/cifar10_input.py", line 23, in
import tensorflow_datasets as tfds
ImportError: No module named 'tensorflow_datasets'

Failing commit ID: fbbee306332e2103906abf34129a97bb68c1465f
Passing commit ID: b4b8c723d377caae2f4243cf8fc711eab71736a1

awaiting response

Most helpful comment

TensorFlow datasets is a standalone package. You need to install it separately.
Try,
pip install tensorflow_datasets before executing the script.
Feel free to reopen if problem still persists. Thanks!

All 10 comments

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks.
What is the top-level directory of the model you are using
Have I written custom code
OS Platform and Distribution
TensorFlow installed from
TensorFlow version
Bazel version
CUDA/cuDNN version
GPU model and memory
Exact command to reproduce

System information:

What is the top-level directory of the model you are using: models/tutorials/image/cifar10/
Have I written custom code : N/A
OS Platform and Distribution (e.g., Linux Ubuntu 16.04):Linux Ubuntu 16.04
TensorFlow installed from (source or binary):pip install
TensorFlow version (use command below): 1.13.2
Bazel version (if compiling from source): bazel 0.19.2
CUDA/cuDNN version: N/A
GPU model and memory: Vega 10 with 16Gb
Exact command to reproduce: /usr/bin/python3 ./cifar10_train.py --max_steps=5000

The solution is to remove all the folders that have been created and then run the code.
I accidentally had to do keyboard interrupt for the command and thus got the same issue some time back it has cropped up again and so can someone tell me the files that are created and where is the database stored.
Thanks in advance

TensorFlow datasets is a standalone package. You need to install it separately.
Try,
pip install tensorflow_datasets before executing the script.
Feel free to reopen if problem still persists. Thanks!

Currently I am struggling with the same problem: ModuleNotFoundError: No module named 'tensorflow_datasets'.
Have tried to run pip install tensorflow_datasets, but it hasn't changed something.

The terminal shows a number of tracebacks:

`ERROR: Error checking for conflicts.
Traceback (most recent call last):
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3012, in _dep_map
    return self.__dep_map
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2806, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3003, in _parsed_pkg_info
    return self._pkg_info
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2806, in __getattr__
    raise AttributeError(attr)
AttributeError: _pkg_info

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 524, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 108, in check_install_conflicts
    package_set, _ = create_package_set_from_installed()
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 47, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2727, in requires
    dm = self._dep_map
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3014, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3023, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3005, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1419, in get_metadata
    value = self._get(self._fn(self.egg_info, name))
  File "/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1607, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/pandas-0.24.2.dist-info/METADATA'
Installing collected packages: tensorflow-estimator
Successfully installed tensorflow-estimator-1.14.0
(base) mbp-maria:~ marialavrovskaa$ find /usr/local/var/pyenv/versions/3.7.0/lib/python3.7/site-packages/ -name METADATA
find: /usr/local/var/pyenv/versions/3.7.0/lib/python3.7/site-packages/: No such file or directory
(base) mbp-maria:~ marialavrovskaa$ /Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/ -name METADATA
-bash: /Users/marialavrovskaa/anaconda3/lib/python3.6/site-packages/: is a directory
(base) mbp-maria:~ marialavrovskaa$ 
`

What I should do to fix it?

try this it solved the problem for me
conda install -c anaconda tensorflow-datasets

try this it solved the problem for me
conda install -c anaconda tensorflow-datasets

I have tensorflow-gpu install in conda.
above command solved the error for me.

tensorflow_datasets is a separate module. You can install by using pip :
pip install tensorflow_datasets

To use tensorflow-datasets in anaconda you have to use the below command

conda install -c anaconda tensorflow-datasets

try this it solved the problem for me
conda install -c anaconda tensorflow-datasets

Thanks @ahmedshingaly
This solved the error for me.

It's good that it helped you Zohaib

Good luck
Niwaha Barnabas
Software Engineer and co-Founder---FamITech Company Limited(
famitechsolutions.com)
quicksafariplanners.com

On Thu, Oct 8, 2020 at 3:22 PM Zohaib Muhammad notifications@github.com
wrote:

try this it solved the problem for me
conda install -c anaconda tensorflow-datasets

Thanks @ahmedshingaly https://github.com/ahmedshingaly
This solved the error for me.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/models/issues/6669#issuecomment-705531444,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFPGOI2DW5XNYELOWNO5OUDSJWVHHANCNFSM4HIMPRUA
.

Was this page helpful?
0 / 5 - 0 ratings