【问题标题】:No module named 'tensorflow' when running train.py in conda environment在 conda 环境中运行 train.py 时没有名为“tensorflow”的模块
【发布时间】:2019-01-19 03:08:29
【问题描述】:

我尝试运行 train.py 文件来训练我的对象检测器,但我收到了 ModuleNotFoundError: No module named 'tensorflow' 错误。我在我的 conda 环境中运行它,我可以在那个环境中导入和使用 tensorflow。有谁知道为什么会这样?谢谢

(fastai-audio) C:\Users\Andrew\Documents\TensorFlow\workspace\classification>train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/pipeline.config
Traceback (most recent call last):
  File "C:\Users\Andrew\Documents\TensorFlow\workspace\classification\train.py", line 47, in <module>
    import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow



【问题讨论】:

  • 你在 train.py 代码中使用了 python shebang 吗?

标签: tensorflow conda object-detection


【解决方案1】:

我不知道如何运行它,所以我决定创建一个 jupyter notebook 来运行 fastai-audio 内核中的单元并且它工作正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-08
    • 1970-01-01
    • 1970-01-01
    • 2020-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多