【发布时间】:2020-04-03 03:22:59
【问题描述】:
我尝试在 CMD 上运行 python。 我在我的 python 文件中导入 tensorflow.contrib。
import tensorflow.contrib.tensorrt as trt
使用此命令在 anaconda 上运行时。
python run_webcam.py --camera yoga.mp4
显示错误:
File "run_webcam.py", line 8, in <module>
from tf_pose.estimator import TfPoseEstimator
File "D:\work\pose estimation\tf-pose-estimation\tf_pose\__init__.py", line 5, in <module>
from tf_pose.runner import infer, Estimator, get_estimator
File "D:\work\pose estimation\tf-pose-estimation\tf_pose\runner.py", line 8, in <module>
from tf_pose import eval
File "D:\work\pose estimation\tf-pose-estimation\tf_pose\eval.py", line 13, in <module>
from tf_pose.estimator import TfPoseEstimator
File "D:\work\pose estimation\tf-pose-estimation\tf_pose\estimator.py", line 14, in <module>
import tensorflow.contrib.tensorrt as trt
ModuleNotFoundError: No module named 'tensorflow.contrib'
我安装了
pip install tensorflow
并更改tensorflow的版本(尝试卸载并安装多个版本)
pip uninstall tensorflow
pip install tensorflow==...
但显示相同的错误
【问题讨论】:
标签: python tensorflow