when training object detection classifier --> ImportError: No module named tensorflow

when training object detection classifier --> ImportError: No module named tensorflow

使用以下命令后

python generate_tfrecord.py --csv_input=images/train_labels.csv --image_dir=images/train --output_path=train.record

我收到以下错误

Traceback (most recent call last):
File "generate_tfrecord.py", line 16, in
import tensorflow as tf
ImportError: No module named tensorflow

如何克服这个错误?

尝试 pip freeze 如果您没有在列表中找到 tensorflow 然后使用下面的命令安装。

pip install --upgrade tensorflow