已经运行过一次的环境再次打开运行提示找不到模块,是每次都要重新安装吗?终端上的执行过的历史命令也未记录。
aistudio@jupyter-2742244-5424451:~$ python PaddleDetection/tools/train.py -c PaddleDetection/configs/yolov3/yolov3_darknet53_270e_voc.yml -r output/yolov3_darknet53_270e_voc/149.pdparams
Traceback (most recent call last):
File "PaddleDetection/tools/train.py", line 32, in
from ppdet.core.workspace import load_config, merge_config
File "/home/aistudio/PaddleDetection/ppdet/__init__.py", line 15, in
from . import (core, data, engine, modeling, model_zoo, optimizer, metrics,
File "/home/aistudio/PaddleDetection/ppdet/data/__init__.py", line 15, in
from . import source
File "/home/aistudio/PaddleDetection/ppdet/data/source/__init__.py", line 19, in
from . import keypoint_coco
File "/home/aistudio/PaddleDetection/ppdet/data/source/keypoint_coco.py", line 22, in
import pycocotools
ModuleNotFoundError: No module named 'pycocotools'
环境会重置,除非:
# 如果需要进行持久化安装, 需要使用持久化路径, 如下方代码示例:
# If a persistence installation is required,
# you need to use the persistence path as the following:
!mkdir /home/aistudio/external-libraries
!pip install beautifulsoup4 -t /home/aistudio/external-libraries
# 同时添加如下代码, 这样每次环境(kernel)启动的时候只要运行下方代码即可:
# Also add the following code,
# so that every time the environment (kernel) starts,
# just run the following code:
import sys
sys.path.append('/home/aistudio/external-libraries')
已经看到了,感谢。
加油!
感谢分享!