No module named 'ppdet'
zhy1997870 发布于2020-03 浏览:6945 回复:0
4
收藏
最后编辑于2022-04

环境配置
Python版本 python3.7
框架版本 PaddlePaddle 1.7.0

使用PaddleDetection,出现这个问题

ModuleNotFoundError: No module named 'ppdet'

 

解决方法:

去这个报错了的py文件 ppdet/modeling/tests/test_architectures.py

在第24行(from ppdet.modeling.tests.decorator_helper import prog_scope)之前添加两行代码

import sys
sys.path.append(r"/home/aistudio/PaddleDetection")

注意里面的路径要换成你的PaddleDetection文件所在的路径。

修改后的这个文件是这样的(部分)

import unittest
import numpy as np
import paddle.fluid as fluid
import sys
sys.path.append(r"/home/aistudio/PaddleDetection")
from ppdet.modeling.tests.decorator_helper import prog_scope
from ppdet.core.workspace import load_config, merge_config, create
收藏
点赞
4
个赞
TOP
切换版块