环境:
tensorflow 1.5.0 +win10+pcharm

问题描述

最近在运行CIFAR_10数据集训练的程序

节选程序如下

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import tensorflow as tf

import tensorflow_datasets as tfds

# Process images of this size. Note that this differs from the original CIFAR
# image size of 32 x 32. If one alters this number, then the entire model
# architecture will change and any model would need to be retrained.
IMAGE_SIZE = 24

出现 ImportError: No module named 'tensorflow_datasets’问题,

解决办法

我打开anaconda3里的anaconda prompt,激活tensorflow环境 activate tensorflow,然后输入

pip install tensorflow-datasets

下载安装即可,记得打开网络。