pyinstaller|pyinstaller 封装pytorch imspect.py的坑

【pyinstaller|pyinstaller 封装pytorch imspect.py的坑】如果你遇到了pyinstaller 封装报torchvision中调用imspect.py 报

File "site-packages\torchvision\ops\misc.py", line 135, in File "site-packages\torchvision\ops\misc.py", line 148, in FrozenBatchNorm2d File "site-packages\torch\jit\__init__.py", line 850, in script_method File "site-packages\torch\jit\frontend.py", line 152, in get_jit_def File "inspect.py", line 973, in getsource File "inspect.py", line 955, in getsourcelines File "inspect.py", line 786, in findsource OSError: could not get source code

那么你很有可能用的torchvision 0.3.0,不多BB,这时候你需要把torchvision降版本到0.2.2应该就没有问题了,这个错目前我搜了好久,只能屈从于版本了。

    推荐阅读