成功解决OSError: [Errno 22] Invalid argument: ‘checkpoints\20211211.pth.tar‘

简介: 成功解决OSError: [Errno 22] Invalid argument: ‘checkpoints\20211211.pth.tar‘

目录

解决问题

解决思路

解决方法


解决问题

checkpoint = torch.load(checkpoint_path)

 File "F:\File_Anaconda\project_py37\envs\lib\site-packages\torch\serialization.py", line 366, in load

   f = open(f, 'rb')

OSError: [Errno 22] Invalid argument: 'checkpoints\20211211.pth.tar'

解决思路

操作系统错误:[Errno 22]无效参数

解决方法

路径符号写错!

checkpoint_path  = 'checkpoints\20211211.pth.tar'

改为

checkpoint_path  = 'checkpoints/20211211.pth.tar'

哈哈,大功告成!


相关文章
|
1月前
|
Python
.repo/repo/main.py“, line 79 file=sys.stderr) SyntaxError: invalid syntax
.repo/repo/main.py“, line 79 file=sys.stderr) SyntaxError: invalid syntax
47 0
成功解决OSError: Unable to open file (truncated file: eof = 8388608, sblock->base_addr = 0, stored_eof =
成功解决OSError: Unable to open file (truncated file: eof = 8388608, sblock->base_addr = 0, stored_eof =
成功解决OSError: Unable to open file (truncated file: eof = 8388608, sblock->base_addr = 0, stored_eof =
|
1月前
|
Python
【报错】Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘/METADATA‘
【报错】Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘/METADATA‘
25 0
|
PyTorch 算法框架/工具
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
172 0
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
|
开发者 Python
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied
365 0
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied
成功解决ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。backend_agg.cp36
成功解决ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。backend_agg.cp36
成功解决ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。backend_agg.cp36
|
Python
FileNotFoundError: [Errno 2] No such file or directory
FileNotFoundError: [Errno 2] No such file or directory
617 0
FileNotFoundError: [Errno 2] No such file or directory
ERROR: Could not install packages due to an Oserror: [Errno 13] Permission denied: RECORD Consider
ERROR: Could not install packages due to an Oserror: [Errno 13] Permission denied: RECORD Consider
948 0
ERROR: Could not install packages due to an Oserror: [Errno 13] Permission denied: RECORD Consider
|
Linux
WARNING: Re-reading the partition table failed with error 22: Invalid argument
在划分磁盘分区时,遇到错误“WARNING: Re-reading the partition table failed with error 22: Invalid argument” 如下所示: [root@DB-Server u02]# fdisk -l   Disk /dev/sda: 500.
2490 0