简体   繁体   English

ModuleNotFoundError:没有名为“lanenet_model”的模块 - Google Colab

[英]ModuleNotFoundError: No module named 'lanenet_model' - Google Colab

I'm trying to use this repository for a lanenet implementation in google colab.我正在尝试将此存储库用于 google colab 中的lanenet 实现。 After cloning the repository I'm want to test out the model by calling:克隆存储库后,我想通过调用测试 model:

!python ./tools/test_lanenet.py --weights_path tusimple_lanenet.ckpt.data-00000-of-00001 --image_path test_img.jpg

I'm calling the file "test_lanenet.py" in the "tools" subfolder.我在“工具”子文件夹中调用文件“test_lanenet.py”。 This file tries to import another python file, which is in another subfolder (lanenet_model/lanenet.py) with:此文件尝试导入另一个 python 文件,该文件位于另一个子文件夹 (lanenet_model/lanenet.py) 中:

from lanenet_model import lanenet

But then I get the Error但后来我得到了错误

Traceback (most recent call last):
  File "./tools/test_lanenet.py", line 20, in <module>
    from lanenet_model import lanenet
ModuleNotFoundError: No module named 'lanenet_model'
  • every subfolder has an __init__.py file每个子文件夹都有一个__init__.py文件
  • I already tried to add the subfolders to the pythonpath - didn't work我已经尝试将子文件夹添加到 pythonpath - 没有用
  • When I print the Pythonpath, regardless of whether I print it in the colab command line or in the.py file, I see that I'm in the right folder (/content/lanenet-lane-detection)当我打印 Pythonpath 时,无论是在 colab 命令行中还是在 .py 文件中打印,我都看到我在正确的文件夹中(/content/lanenet-lane-detection)

Does anybody has an idea what I can do to fix the problem?有人知道我能做些什么来解决这个问题吗?

Here's the folder tree: lanenet folders这是文件夹树: lanenet 文件夹

Try moving the.py file you want to run to the project root path, then run.尝试将要运行的.py文件移动到项目根路径下,然后运行。 such as

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ModuleNotFoundError:Google Colab 上没有名为“nets”的模块 - ModuleNotFoundError: No module named 'nets' on Google Colab ModuleNotFoundError:Google Colab 中没有名为“pyaudio”的模块 - ModuleNotFoundError: No module named 'pyaudio' in Google Colab Google colab:ModuleNotFoundError:没有名为“pymorphy2”的模块 - Google colab : ModuleNotFoundError: No module named 'pymorphy2' ModuleNotFoundError:没有名为“google.colab”的模块 - Python - ModuleNotFoundError: No module named 'google.colab' - Python Google Colab:ModuleNotFoundError:没有名为“base_positioner”的模块 - Google Colab : ModuleNotFoundError: No module named 'base_positioner' Google Colab ModuleNotFoundError:没有名为“sklearn.externals.joblib”的模块 - Google Colab ModuleNotFoundError: No module named 'sklearn.externals.joblib' ModuleNotFoundError:Google Colab 中没有名为“tensorflow_data_validation”的模块 - ModuleNotFoundError: No module named 'tensorflow_data_validation' in Google Colab 在 google colab 中安装并运行 fairseq(ModuleNotFoundError:没有名为“fairseq”的模块) - install and run fairseq in google colab (ModuleNotFoundError: No module named 'fairseq') 在Google Colab中针对“注意ocr”修复“ ModuleNotFoundError:没有名为&#39;fsns&#39;的模块” - Fix “ModuleNotFoundError: No module named 'fsns'” in google colab for Attention ocr 如何解决 ModuleNotFoundError:没有名为“google.colab”的模块 - How to resolve ModuleNotFoundError: No module named 'google.colab'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM