簡體   English   中英

訓練 tensorflow model 時出錯:在“Tensorflow”中找不到“__main__”模塊

[英]Error training tensorflow model: can't find '__main__' module in 'Tensorflow'

我正在嘗試在 jupyter 筆記本中的 windows 上訓練 tensorflow model。 環境和object檢測API安裝正確。

我在配置路徑后運行此命令:

print("""python {}/research/object_detection/model_main_tf2.py --model_dir={}/{} --pipeline_config_path={}/{}/pipeline.config --num_train_steps=5000""".format(APIMODEL_PATH, MODEL_PATH,CUSTOM_MODEL_NAME,MODEL_PATH,CUSTOM_MODEL_NAME))

並得到這個 output:

python Tensorflow / models / research / object_detection / model_main_tf2.py --model_dir = Tensorflow / workspace / models / my_ssd_mobnet --pipeline_config_path = Tensorflow / workspace / models / my_ssd_mobnet / pipeline.config --num_train_steps = 3000

但是,當我實際嘗試使用相同的 output 在我的終端中訓練 model 時,它給了我錯誤:

C:\ProgramData\Anaconda3\python.exe:在“Tensorflow”中找不到“ main ”模塊

有人可以提供一些解決此錯誤的方法嗎?

您需要 go 到此路徑“tensorflow/models/research”並將此行放在命令行中:

cd /path-to/models-master/research/
python setup.py build
python setup.py install

然后這樣做以避免額外的錯誤

cd /path-to/models-master/research/slim
python setup.py build
python setup.py install

問候。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM