当前位置:网站首页>Although pycharm is marked with red in the run-time search path, it does not affect the execution of the program

Although pycharm is marked with red in the run-time search path, it does not affect the execution of the program

2022-07-01 06:15:00 Martian radish

 stay pycharm  The following package cannot be found in the Interim Report from models.yolo_layer import YoloLayer, But the path for searching packets has been imported in the front of this line , The runtime does not report an error , It's just pycharm When analyzing the static code structure, the red flag indicates that the package cannot be found 


import os
import sys
PACKAGE_PARENT = '..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT)))

from models.yolo_layer import YoloLayer
from models.darknet_utils import parse_cfg, print_cfg, load_fc, load_conv_bn, load_conv
from utils.torch_utils import to_cpu
原网站

版权声明
本文为[Martian radish]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/182/202207010533215439.html