pyinstaller 打包 torch\_jit_internal.py:750: UserWarning: Unable to retrieve source for @torch.jit._ov
运行的时候不报错,但是打包以后,由于调用了pytorch,所以报了如下错误
torch\_jit_internal.py:750: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x0000012D8ED93310>.warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
torch\_jit_internal.py:750: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x0000012D8EDAD550>.warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
<super: <class 'PreviewQWindow'>, <PreviewQWindow object>>
<super: <class 'MainQWindow'>, <MainQWindow object>>
torch\_jit_internal.py:750: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x000001FF690D7310>.warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
torch\_jit_internal.py:750: UserWarning: Unable to retrieve source for @torch.jit._overload function: <function _DenseLayer.forward at 0x000001FF690ED550>.warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.")
从github的反馈来看,这并不算error,只是warning,程序可以正常执行,只是在控制台上不美观
有两种解决方法:
方法1:
打包的时候添加以下语句:
–hidden-import torch.jit
但我试了,并没有用
方法2
将torch文件里的这句话注释掉(外网也是这么干的,需要注意是对应虚拟环境里的torch,不要找错了)
路径:X:\Anaconda3\envs\(虚拟环境名)\Lib\site-packages\torch_jit_internal.py
打开_jit_internal.py,从warning可知,是在750行处报错,找到750行:
如下图所示:
将warnings.warn(f"Unable to retrieve source for @torch.jit._overload function: {func}.") 注释掉
这样重新打包就可以了
如果不带console输出控制台,也可以不改
pyinstaller 打包 torch\_jit_internal.py:750: UserWarning: Unable to retrieve source for @torch.jit._ov相关推荐
- 用pyinstaller打包多个py文件转成exe格式
用pyinstaller打包多个py文件转成exe格式 用pyinstaller打包多个py文件转成exe格式 响应国家号召2019-Ncov 在家闲来无聊,学写一个飞船攻打外星人的python程序, ...
- 详解 pyinstaller 打包多个py文件
前言 最近有个需求要把python项目打包成可执行程序运行,看了很多帖子,大多数博主都采用pyinstall 打包,看着也不难,本以为很简单的事情,对于我这个新手来说也折腾了2个多小时吧,记录下遇到的 ...
- Pyinstaller打包引用其他文件(.py或其他格式)的.py文件
Pyinstaller打包多个.py文件 一.安装Pyinstaller 二.使用步骤 1.进入主程序目录生成.spec文件 2.修改.spec文件以导入其他文件 3.运行.exe文件 一.安装Pyi ...
- Pyinstaller 打包 torch 后执行失败 OSError: could not get source code
1. 问题现象 系统环境 Python 3.6.9 torch 1.2.0 torchvision 0.4.0 Pyinstaller 4.5.1 Pyinstaller 打包 torch 后执行失败 ...
- pyinstaller打包教程及错误RuntimeError: Unable to open ./shape_predictor_68_face_landmarks.dat
pyinstaller打包教程及错误RuntimeError: Unable to open ./shape_predictor_68_face_landmarks.dat pyinstaller基本 ...
- pyinstaller打包torch运行后报错
pyinstaller打包torch运行后报错 这个实际上网上很多类似的,但不太相同,得观察报错信息是否一致.如果报错的最后面有torchvision,则应该是版本问题,进行版本修改估计就ok了,但如 ...
- pyinstaller打包torch出现OSError: could not get source code、pkg_resources.DistributionNotFound
记下主要怕以后自己忘记 首先打包先建一个虚拟环境,就装上打包的python需要的包,这样打包起来错误可能会少点,而且速度也会快些,大小也可能小些,如何创建可以参考我的另一篇博客https://blog ...
- pyinstaller 打包py文件 以及字体、图片等资源的引用
文章目录 1. 改变控制台的编码格式为utf-8 ,在控制台中输入 2. 一般打包可用 pyinstaller -F -i abc.ico xxx.py --noconsole 3. 参数如下: 4. ...
- pyinstaller打包任何py文件TypeError: an integer is required (got type bytes)
pyinstaller打包任何py文件TypeError: an integer is required (got type bytes) 目录 pyinstaller打包任何py文件TypeErro ...
最新文章
- 2021,软科中国大学排名新鲜出炉!清华、北大、浙大位居前三!
- Python 中的 eavl() 函数
- Js高设笔记1-2章 defer and async
- sshd_config配置详解
- System.FormatException: GUID 应包含带 4 个短划线的 32 位数(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)。...
- ie浏览器升级_IE 被微软专家从浏览器里除名了,专家说它只是个兼容性解决方案...
- java+jvm+log_java8添加并查看GC日志(ParNew+CMS)
- golang 解析php序列化,golang实现php里的serialize()和unserialize()序列和反序列方法
- C# 图解教程 第一章 C#和.NET框架
- BGP十三条选路原则
- 手机号码归属地查询数据库下载
- jsp实现简易购物车
- 非常好用的354款Procreate新型笔刷
- 使用Hbase Shell和Java API分别进行Hbase的增删改查操作
- 汽车EE架构 发展过程
- VC++实现QQ消息群发
- html做战网首页,战网更新agent一半不动
- Elasticsearch生产集群健康状况为yellow原因分析和解决方案
- 咖啡店管理系统设计与实现C语言,答粉丝问|GUI编程实例化之咖啡店点单系统
- linux最上层目录是什么,Linux基础知识之--目录组成结构,当前目录及上层目录表示方法,目录访问权限...
热门文章
- word打印机显示服务器脱机,excel服务器-办公室常识——共享服务器文件报错,共享打印机无法打印的解决办法(解决word、excel不能打印))...
- 常用车载总线CAN、CAN FD、LIN、FlexRay、Ethernet介绍
- Linux Graphics 周刊(第 9 期)
- [译]使用MVI打造响应式APP(八):导航
- fooview辅助功能 shell_Fooview:一款功能超多的桌面悬浮球,帮你摆脱多余操作
- 输入手机号获取验证码的注册页面,说出测试过程
- 关于kali连不上网络
- 计算机桌面显示变小,电脑屏幕变小怎么还原回来
- 机器学习的统计方法 贝叶斯决策理论入门
- 正版win7系统下载重装教程