1

I was downloading torch and after 99% completion of the download, I am getting this error. I am using Ubuntu, on an 8gb ram system.

the memory allocation

ankita@ankita-HP-Laptop-15-bs0xx:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:           7.7G        2.0G        1.6G        495M        4.1G        5.0G
Swap:            0B          0B          0B

the error code

harddisk distribution

jps
  • 20,041
  • 15
  • 75
  • 79
Ankita Prasad
  • 57
  • 1
  • 9
  • as you've probably guessed -- you're running out of memory -- maybe try closing chrome? – anthony sottile Feb 14 '20 at 05:27
  • but that happened 4 times in a row. But let me try for that too :/ – Ankita Prasad Feb 14 '20 at 06:59
  • it didn't helped, the same error again popped out with no background processes running along with. – Ankita Prasad Feb 14 '20 at 08:26
  • Try downloading with other tool, e.g. `wget https://files.pythonhosted.org/packages/46/ca/306bb933a68b888ab1c20ede0342506b85857635f04fb55a56e53065579b/torch-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl`, then install from disk via `pip install torch --find-links .` – hoefling Feb 14 '20 at 14:53

1 Answers1

0

I've also experienced this problem due to lack of RAM. You may try increasing the swap space. Try methods mentioned here.

The best solution is to install pytorch using conda, rather than pip. You won't encounter memory error then.

kHarshit
  • 11,362
  • 10
  • 52
  • 71
  • while installing the same package via conda it says "PackagesNotFoundError" – Ankita Prasad Feb 14 '20 at 08:34
  • Use `conda install pytorch torchvision cudatoolkit=10.1 -c pytorch` for gpu and `conda install pytorch torchvision cpuonly -c pytorch` for cpu, check command from [pytorch website](https://pytorch.org/get-started/locally/). – kHarshit Feb 14 '20 at 09:15