当前位置:网站首页>运行时候的导包搜索路径虽然pycharm中标红但不影响程序的执行
运行时候的导包搜索路径虽然pycharm中标红但不影响程序的执行
2022-07-01 05:33:00 【火星种萝卜】
在pycharm 中报如下包找不到from models.yolo_layer import YoloLayer,但是该行的前面已经导入了搜包的路径,运行时并不报错,只是pycharm在分析静态代码结构层面会标红提示找不到包 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
边栏推荐
猜你喜欢
Summary of spanner's paper
如何创建一个根据进度改变颜色的进度条
Leetcode top 100 question 2 Add two numbers
SSM的教务管理系统(免费源码获取)
Use and principle of wait notify
数据库连接池的简单实现
Application and principle of ThreadPoolExecutor thread pool
Use and principle of Park unpark
0xc000007b the application cannot start the solution normally (the pro test is valid)
Day 05 - file operation function
随机推荐
LevelDB源码分析之memtable
Leetcode top 100 question 2 Add two numbers
激活函数简述
Numeric amount plus comma; JS two methods of adding three digits and a comma to numbers; JS data formatting
了解 JVM 中几个相关问题 — JVM 内存布局、类加载机制、垃圾回收
Use and principle of AQS related implementation classes
Printk debugging summary
Application of industrial conductive slip ring
HDU - 1069 Monkey and Banana(DP+LIS)
idea启动查看项目端口
Boot + jsp University Community Management System (with source Download Link)
Ssgssrcsr differences
Is there any good website or software for learning programming? [introduction to programming]?
el-cascader回显失败;el-cascader回显不出来
Mongodb学习篇:安装后的入门第一课
Educational administration management system (free source code)
CentOS 7 installed php7.0 using Yum or up2date
Basic electrician knowledge 100 questions
轩逸保养手册
第05天-文件操作函数