将目录路径定义为变量或常量时,它是否应以尾部斜杠结尾?惯例是什么?
pwd在unix中显示当前目录没有尾部斜杠,而选项卡完成cd /var/www/apps/包括尾部斜杠,这让我不确定.
我是 PyTorch 的初学者,我只是在此网页上尝试一些示例。但由于此错误,我似乎无法运行“super_resolution”程序:
RuntimeError: DataLoader worker (pid(s) 15332) exited unexpectedly
我在网上搜索,发现有人建议设置num_workers为0. 但是如果我这样做,程序会告诉我内存不足(CPU 或 GPU):
RuntimeError: [enforce fail at ..\c10\core\CPUAllocator.cpp:72] data. DefaultCPUAllocator: not enough memory: you tried to allocate 9663676416 bytes. Buy new RAM!
或者
RuntimeError: CUDA out of memory. Tried to allocate 1024.00 MiB (GPU 0; 4.00 GiB total capacity; 2.03 GiB already allocated; 0 bytes free; 2.03 GiB reserved in total by PyTorch)
我该如何解决?
我在 Win10(64 位)和 pytorch 1.4.0 上使用 python 3.8。
更完整的错误信息( …