Q1:THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them. tensorflow from https://mirrors.aliyun.com/pypi/packages/aa/fd/993aa1333eb54d9f000863fe8ec61e41d12eb833dea51484c76c038718b5/tensorflow-2.5.0-cp37-cp37m-manylinux2010_x86_64.whl#sha256=739d25273ccc10fedc74517de099bd5b16a274d1295fad6bfef834ad28cc3401:
Expected sha256 739d25273ccc10fedc74517de099bd5b16a274d1295fad6bfef834ad28cc3401
Got 412b455aeb82b5551c580f65a7c846b53ed021ec3b2e535ffeb65e54b6b498fe
image.png
image.png

Q2:RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn

常见报错码汇总 - 图3

Q3:RuntimeError: CUDA out of memory. Tried to allocate 98.00 MiB (GPU 0; 4.00 GiB total capacity; 2.67 GiB already allocated; 90.28

报错码:
RuntimeError: CUDA out of memory. Tried to allocate 98.00 MiB (GPU 0; 4.00 GiB total capacity; 2.67 GiB already allocated; 90.28 MiB free; 2.80 GiB reserved in total by PyTorch)

如果是在云端JupyterLab跑代码,在Run里面Clear All Outputs即可。如果还是报错,说明云端的内存也不够了。

详情点击下面图片进入链接(如果发现终端显示没有进程在运行,说明GPU本身的内存不够了,只能在云端训练了)
image.png

Q4:command not found: tensorboard

image.png

Q5:RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor)

image.png