新的服務(wù)器CUDA版本是10.0陈轿,與torch-0.4.0,torchvision -0.2.1不匹配秦忿。(之前CUDA版本9.0 裝的是這個(gè))
出現(xiàn)了
UserWarning:
? ? Found GPU0 GeForce RTX 2080 Ti which requires CUDA_VERSION >= 9000 for
? ? optimal performance and fast startup time, but your PyTorch was compiled
? ? with CUDA_VERSION 8000. Please install the correct PyTorch binary
? ? using instructions from http://pytorch.org
……
OSError: [Errno 12] Cannot allocate memory麦射。
檢查內(nèi)存后內(nèi)存充足,且代碼需要的內(nèi)存很少灯谣,考慮是版本問(wèn)題潜秋。
新建了python環(huán)境:conda create --name py36_torch python=3.6
裝了最新版的torch(1.3.1)和torchvison(0.4.2)
pip install torch torchvision -i https://pypi.douban.com/simple
運(yùn)行測(cè)試代碼成功!(先安裝代碼需要的庫(kù))