当前位置:   article > 正文

【解决---复现Ultra-Fast-Lane-Detection-v2---ModuleNotFoundError: No module named ‘nvidia‘ 】_modulenotfounderror: no module named 'nvidia

modulenotfounderror: no module named 'nvidia

项目场景:

复现Ultra-Fast-Lane-Detection-v2道路标线检测


问题描述

执行该代码:

python train.py /line_detection/UFLD-v2/configs/tusimple_res18.py  --log_path /line_detection/UFLD-v2/log

  • 1
  • 2

报错:

ModuleNotFoundError: No module named 'nvidia':

具体如下:

Traceback (most recent call last):
  File "train.py", line 8, in <module>
    from utils.common import calc_loss, get_model, get_train_loader, inference, merge_config, save_model, cp_projects
  File "/line_detection/UFLD-v2/utils/common.py", line 2, in <module>
    from data.dali_data import TrainCollect
  File "/line_detection/UFLD-v2/data/dali_data.py", line 4, in <module>
    from nvidia.dali.pipeline import Pipeline
ModuleNotFoundError: No module named 'nvidia'

	}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

原因分析:

缺少了某种文件conda list | grep nvidia

没有输出

所以执行以下命令:

 $ pip install nvidia-pyindex
 $ pip install nvidia-dali

  • 1
  • 2
  • 3

再次执行 conda list | grep nvidia

输出如下:

nvidia-dali               0.7.0                    pypi_0    pypi
nvidia-pyindex            1.0.9                    pypi_0    pypi
  • 1
  • 2

再次执行该代码:

python train.py /line_detection/UFLD-v2/configs/tusimple_res18.py  --log_path /line_detection/UFLD-v2/log

  • 1
  • 2

报错如下:

Traceback (most recent call last):
  File "train.py", line 8, in <module>
    from utils.common import calc_loss, get_model, get_train_loader, inference, merge_config, save_model, cp_projects
  File "//line_detection/UFLD-v2/utils/common.py", line 2, in <module>
    from data.dali_data import TrainCollect
  File "/line_detection/UFLD-v2/data/dali_data.py", line 6, in <module>
    import nvidia.dali.fn as fn
ModuleNotFoundError: No module named 'nvidia.dali.fn'

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

解决方案:

执行以下命令:
注意对应cuda的版本

cuda102

pip install --extra-index-url https://developer.download.nvidia.com/compute/redist --upgrade nvidia-dali-cuda102
  • 1

cuda110

pip install --extra-index-url https://developer.download.nvidia.com/compute/redist --upgrade nvidia-dali-cuda110
  • 1

cuda100

pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/cuda/10.0 nvidia-dali
  • 1

问题解决!!!!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/129859
推荐阅读
相关标签
  

闽ICP备14008679号