簡體   English   中英

實時 object 檢測沒有名為“tensorflow.compat.v1”的模塊

[英]realtime object detection No module named 'tensorflow.compat.v1'

我正在關注https://automaticaddison.com/real-time-object-recognition-using-a-webcam-and-deep-learning/#top上的實時 object 檢測,我遇到了障礙,我遵循了所有說明並檢查是否有任何錯誤,但仍然出現此錯誤(我正在使用 Windows)

 Traceback (most recent call last):   File "object_detection_test.py",
 line 15, in <module>
     from utils import label_map_util   File "C:\Users\1rock\Documents\TensorFlow\models\research\object_detection\utils\label_map_util.py",
 line 27, in <module>
     import tensorflow.compat.v1 as tf ModuleNotFoundError: No module named 'tensorflow.compat.v1'

我使用pip install --ignore-installed --upgrade tensorflow==1.9就像上面的鏈接所說的那樣,在運行時我得到了這些包及其版本,並出現錯誤希望它與問題相關

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.

ipywidgets 7.6.0 requires jupyterlab-widgets>=1.0.0, which is not installed.

Successfully installed absl-py-0.11.0 astor-0.8.1 gast-0.4.0 grpcio-1.34.0 importlib-metadata-3.3.0 markdown-3.3.3 numpy-1.19.4 protobuf-3.14.0 setuptools-51.0.0.post20201207 six-1.15.0 tensorboard-1.9.0 tensorflow-1.9.0 termcolor-1.1.0 typing-extensions-3.7.4.3 werkzeug-1.0.1 wheel-0.36.2 zipp-3.4.0

我用 pip install --ignore-installed --upgrade tensorflow==1.9

第 27 行,在 import tensorflow.compat.v1 as tf ModuleNotFoundError: No module named 'tensorflow.compat.v1'

TF 1.9 及更早版本沒有compat模塊。 要使用它,您需要 TF 1.10+。 最好在 conda 虛擬環境的任何地方使用 conda install。

此外,由於您使用的是tensorflow 型號,請確保您具有相應版本的存儲庫,例如最新的 TF1.x 版本位於此處

暫無
暫無

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

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