我正在尝试加载我的数据集,它以前可以工作,但突然间这个错误开始出现。
当我尝试像这样加载它时:
train_set = Database_load(root = "C:\\Users\\Public\\PhysNet\\",train = "train.pth")
它给了我以下错误:
File "C:\Users\Public\Lucas\PhysNet\modt.py", line 185, in <module>
train_set = Database_load(root = "C:\\Users\\Public\\Lucas\\PhysNet\\",train = "train.pth")
File "C:\Users\Public\Lucas\PhysNet\database_load.py", line 21, in __init__
self.data, self.y1, self.y2= torch.load(os.path.join(self.root, self.train))
File "C:\ProgramData\Anaconda3\envs\project\lib\site-packages\torch\serialization.py", line 386, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File "C:\ProgramData\Anaconda3\envs\project\lib\site-packages\torch\serialization.py", line 580, in _load
deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly)
OSError: [Errno 22] Invalid argument
输入路径时我也尝试过执行以下操作,但没有成功:
train_set = Database_load(root = r"C:\\Users\\Public\\PhysNet\\",train = "train.pth")
train_set = Database_load(root = r'C:/Users/Public/PhysNet/',train = 'train.pth')
有关如何解决此问题的任何建议?