error installing pytorch-pretrained-bert

Trying to install this python library but it keeps failing. I have installed the latest: torch-1.2.0a0+8554416-cp36-cp36m-linux_aarch64.whl from here: https://devtalk.nvidia.com/default/topic/1049071/jetson-nano/pytorch-for-jetson-nano-version-1-2-0-now-available/

pip3 install pytorch-pretrained-bert
Collecting pytorch-pretrained-bert
Using cached https://files.pythonhosted.org/packages/d7/e0/c08d5553b89973d9a240605b9c12404bcf8227590de62bae27acbcfe076b/pytorch_pretrained_bert-0.6.2-py3-none-any.whl
Collecting regex (from pytorch-pretrained-bert)
Downloading https://files.pythonhosted.org/packages/6f/a6/99eeb5904ab763db87af4bd71d9b1dfdd9792681240657a4c0a599c10a81/regex-2019.08.19.tar.gz (654kB)
100% |████████████████████████████████| 655kB 535kB/s
Collecting torch>=0.4.1 (from pytorch-pretrained-bert)
Could not find a version that satisfies the requirement torch>=0.4.1 (from pytorch-pretrained-bert) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
No matching distribution found for torch>=0.4.1 (from pytorch-pretrained-bert)

Hi,

That is because torch version is 1.2.0a0+8554416 and it may not be recognized by the pip3.
You can try the installation with –ignore-installed config to see if helps.

But actually, I can install the pytorch-pretrained-bert package without issues:

nvidia@nvidia-desktop:~$ sudo pip3 install pytorch-pretrained-bert
WARNING: The directory '/home/nvidia/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/home/nvidia/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pytorch-pretrained-bert
  Downloading https://files.pythonhosted.org/packages/d7/e0/c08d5553b89973d9a240605b9c12404bcf8227590de62bae27acbcfe076b/pytorch_pretrained_bert-0.6.2-py3-none-any.whl (123kB)
     |████████████████████████████████| 133kB 1.1MB/s 
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from pytorch-pretrained-bert) (1.16.4)
Collecting regex (from pytorch-pretrained-bert)
  Downloading https://files.pythonhosted.org/packages/6f/a6/99eeb5904ab763db87af4bd71d9b1dfdd9792681240657a4c0a599c10a81/regex-2019.08.19.tar.gz (654kB)
     |████████████████████████████████| 655kB 14.7MB/s 
Collecting tqdm (from pytorch-pretrained-bert)
  Downloading https://files.pythonhosted.org/packages/e1/c1/bc1dba38b48f4ae3c4428aea669c5e27bd5a7642a74c8348451e0bd8ff86/tqdm-4.36.1-py2.py3-none-any.whl (52kB)
     |████████████████████████████████| 61kB 10.0MB/s 
Requirement already satisfied: torch>=0.4.1 in /usr/local/lib/python3.6/dist-packages (from pytorch-pretrained-bert) (1.2.0a0+8554416)
Collecting boto3 (from pytorch-pretrained-bert)
  Downloading https://files.pythonhosted.org/packages/cd/c0/180d7b899d00353d4421a396686004f4d5e32e0ee9aee762dea857815c18/boto3-1.9.235-py2.py3-none-any.whl (128kB)
     |████████████████████████████████| 133kB 14.7MB/s 
Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from pytorch-pretrained-bert) (2.22.0)
Collecting botocore<1.13.0,>=1.12.235 (from boto3->pytorch-pretrained-bert)
  Downloading https://files.pythonhosted.org/packages/7c/48/431bcc5692592b14dd32c4484e6508d4f777fc99991dc45ed7d2fc4d5b83/botocore-1.12.235-py2.py3-none-any.whl (5.7MB)
     |████████████████████████████████| 5.7MB 15.1MB/s 
Collecting s3transfer<0.3.0,>=0.2.0 (from boto3->pytorch-pretrained-bert)
  Downloading https://files.pythonhosted.org/packages/16/8a/1fc3dba0c4923c2a76e1ff0d52b305c44606da63f718d14d3231e21c51b0/s3transfer-0.2.1-py2.py3-none-any.whl (70kB)
     |████████████████████████████████| 71kB 10.5MB/s 
Collecting jmespath<1.0.0,>=0.7.1 (from boto3->pytorch-pretrained-bert)
  Downloading https://files.pythonhosted.org/packages/83/94/7179c3832a6d45b266ddb2aac329e101367fbdb11f425f13771d27f225bb/jmespath-0.9.4-py2.py3-none-any.whl
Requirement already satisfied: idna<2.9,>=2.5 in /usr/lib/python3/dist-packages (from requests->pytorch-pretrained-bert) (2.6)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/lib/python3/dist-packages (from requests->pytorch-pretrained-bert) (1.22)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3/dist-packages (from requests->pytorch-pretrained-bert) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests->pytorch-pretrained-bert) (2018.1.18)
Collecting docutils<0.16,>=0.10 (from botocore<1.13.0,>=1.12.235->boto3->pytorch-pretrained-bert)
  Downloading https://files.pythonhosted.org/packages/22/cd/a6aa959dca619918ccb55023b4cb151949c64d4d5d55b3f4ffd7eee0c6e8/docutils-0.15.2-py3-none-any.whl (547kB)
     |████████████████████████████████| 552kB 16.9MB/s 
Requirement already satisfied: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in /usr/lib/python3/dist-packages (from botocore<1.13.0,>=1.12.235->boto3->pytorch-pretrained-bert) (2.6.1)
Building wheels for collected packages: regex
  Building wheel for regex (setup.py) ... done
  Created wheel for regex: filename=regex-2019.8.19-cp36-cp36m-linux_aarch64.whl size=615232 sha256=bbf8801e14f40159f051e150d43683a0a6ad9ca0b25746733698b55c54582638
  Stored in directory: /home/nvidia/.cache/pip/wheels/90/04/07/b5010fb816721eb3d6dd64ed5cc8111ca23f97fdab8619b5be
Successfully built regex
Installing collected packages: regex, tqdm, jmespath, docutils, botocore, s3transfer, boto3, pytorch-pretrained-bert
Successfully installed boto3-1.9.235 botocore-1.12.235 docutils-0.15.2 jmespath-0.9.4 pytorch-pretrained-bert-0.6.2 regex-2019.8.19 s3transfer-0.2.1 tqdm-4.36.1

Thanks.

glad it worked for you and the good news is that I tried it again and it installed just like for you.
don’t know if someone fixed something or just had a typo. only difference since last night is I shutdown the jetson and turned it back on this morning.

thank you for your help.

Hi,

One possibility is that we execute the command with ‘root’.
Please let us know the result.

Thanks.

Thanks for your help. Yea it is working now and I did have to use sudo with the command for it to install.
Also for others using pytorch as you use more intense processing the unit will require the higher 5v - 4amp power adapter.
My unit kept shutting down after a certain amount of processing. I guess the OS/HW doesn’t catch this situation and it just shuts down.
Once I had the bigger power supply, it ran fine.