ImportError:没有名为tensorflow_hub的模块

2024-10-01 02:27:38 发布

您现在位置:Python中文网/ 问答频道 /正文

使用这个instruction为Android做一个机器学习模型。在

在我把这些行放入命令行之后

python retrain.py
--bottleneck_dir=/{directory_to_bottlenecks }/bottlenecks        
--how_many_training_steps 1000
--model_dir=/{directory_to_folder_you_saved_the_mobilenet}/mobileNet
--output_graph=/{directory_to_folder_you_want_to_save_the_model}/papa_graph.pb
--output_labels=/{directory}/papa_labels.txt
--image_dir /{directory_to_images_folder}

现在有个错误。在

File "retrain.py", line 134, in import tensorflow_hub as hub ImportError: No module named tensorflow_hub

奥斯:卡塔琳娜。在

做了和别人说的完全一样的事。安装过程中没有错误。我已经检查了是否有tensorflow_hub文件夹。对。在

/usr/local/lib/python3.6/site-packages

以前和水蟒合作安装pip,Tensorflow。。。 它看不到文件夹。 最好的解决方案是什么?在


Tags: thetopyyououtputmodeltensorflowdir
1条回答
网友
1楼 · 发布于 2024-10-01 02:27:38

正如Dan-Dev提到的,问题出在python版本上。这是关于Android机器学习的第五个教程,一步一步不起作用。在

多亏了新版macOS Catalina-所有以前的模块和环境都被替换了。因此,即使我修复了这个错误,还是会出现很多新问题:

pip install tf-nightly-2.0-preview

每晚安装/更新tf根本不起作用。 此外,在命令行更新后:

zsh: command not found: conda

zsh: command not found: brew

zsh: command not found: curl

zsh: command not found: ruby

zsh: command not found: gcc

结论:

问题1默认情况下使用不同版本的Python,pip。在

问题2太多的macOS版本的Catalina。在

相关问题 更多 >