Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when building wheels for torch #740

Closed
rdatasculptor opened this issue Mar 18, 2020 · 13 comments
Closed

Error when building wheels for torch #740

rdatasculptor opened this issue Mar 18, 2020 · 13 comments

Comments

@rdatasculptor
Copy link

I tried to install and use the new package golgotha (initialized by my NLP hero Jan Wijffels, from bnosac) which can be found here. This package is an interface to the transformers module written in Python. When I run this code:

devtools::install_github("bnosac/golgotha", INSTALL_opts = "--no-multiarch")
library(golgotha)
transformer_download_model("bert-base-multilingual-uncased")

something goes wrong after installing r miniconda, starting with building wheels for torch. Can this be a bug or do I something wrong in my settings?

These are the settings as it has been put down in the description file of the package:

Package: golgotha
Type: Package
Title: Contextualised Embeddings and Language Modelling using BERT and Friends
Version: 0.2.0
Maintainer: Jan Wijffels <jwijffels@bnosac.be>
Authors@R: c(
    person('Jan', 'Wijffels', role = c('aut', 'cre', 'cph'), email = 'jwijffels@bnosac.be'), 
    person('BNOSAC', role = 'cph'))
Description: Wraps the transformers Python module in order to easily obtain contextualised embeddings of sentences.
    This work was basically done in order to ease the work of building predictive models using BERT-like embeddings.
License: MPL-2.0
Encoding: UTF-8
Suggests: 
    tinytest
Depends:
    reticulate (>= 1.14)
Config/reticulate:
  list(
    packages = list(
      list(package = "torch", pip = TRUE),
      list(package = "transformers", version = "2.4.1", pip = TRUE)
    )
  )    
RoxygenNote: 6.1.1

And this is the output I get after running the installation script:

> devtools::install_github("bnosac/golgotha", INSTALL_opts = "--no-multiarch")
Downloading GitHub repo bnosac/golgotha@master
Installing 1 packages: reticulate
Installing package into ‘C:/Users/jelle/Documents/Rlibrary’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/reticulate_1.14.zip'
Content type 'application/zip' length 1724346 bytes (1.6 MB)
downloaded 1.6 MB

package ‘reticulate’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
	C:\Users\jelle\AppData\Local\Temp\RtmpqOBJl2\downloaded_packages
√  checking for file 'C:\Users\jelle\AppData\Local\Temp\RtmpqOBJl2\remotes2c4410e1588c\bnosac-golgotha-728659c/DESCRIPTION' (373ms)
-  preparing 'golgotha':
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'golgotha_0.2.0.tar.gz'
   
Installing package into ‘C:/Users/jelle/Documents/Rlibrary’
(as ‘lib’ is unspecified)
* installing *source* package 'golgotha' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'golgotha'
    finding HTML links ... done
    BERT                                    html  
    bert_download_model                     html  
    predict.Transformer                     html  
    transformer                             html  
    transformer_download_model              html  
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (golgotha)
> transformer_download_model("bert-base-multilingual-uncased")
Error in transformer_download_model("bert-base-multilingual-uncased") : 
  could not find function "transformer_download_model"
> library(golgotha)
Loading required package: reticulate
- Connecting/Setting up Python using reticulate
- Loading golgotha BERT code
> transformer_download_model("bert-base-multilingual-uncased")
Downloading model to C:/Users/jelle/Documents/Rlibrary/golgotha/models/bert-base-multilingual-uncased
No non-system installation of Python could be found.
Would you like to download and install Miniconda?
Miniconda is an open source environment management system for Python.
See https://docs.conda.io/en/latest/miniconda.html for more details.

Would you like to install Miniconda? [Y/n]: y
* Downloading "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" ...
trying URL 'https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe'
Content type 'application/octet-stream' length 54141072 bytes (51.6 MB)
downloaded 51.6 MB

* Installing Miniconda -- please wait a moment ...
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: C:\Users\jelle\AppData\Local\r-miniconda

  added / updated specs:
    - conda


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-4.8.3                |           py37_0         2.8 MB
    idna-2.9                   |             py_1          49 KB
    openssl-1.1.1e             |       he774522_0         4.8 MB
    pycparser-2.20             |             py_0          92 KB
    requests-2.23.0            |           py37_0          93 KB
    setuptools-46.0.0          |           py37_0         535 KB
    tqdm-4.43.0                |             py_0          56 KB
    ------------------------------------------------------------
                                           Total:         8.5 MB

The following packages will be UPDATED:

  conda                                        4.8.2-py37_0 --> 4.8.3-py37_0
  idna                    pkgs/main/win-64::idna-2.8-py37_0 --> pkgs/main/noarch::idna-2.9-py_1
  openssl                                 1.1.1d-he774522_4 --> 1.1.1e-he774522_0
  pycparser          pkgs/main/win-64::pycparser-2.19-py37~ --> pkgs/main/noarch::pycparser-2.20-py_0
  requests                                    2.22.0-py37_1 --> 2.23.0-py37_0
  setuptools                                  45.2.0-py37_0 --> 46.0.0-py37_0
  tqdm                                          4.42.1-py_0 --> 4.43.0-py_0



Downloading and Extracting Packages
pycparser-2.20       | 92 KB     | ########## | 100% 
openssl-1.1.1e       | 4.8 MB    | ########## | 100% 
setuptools-46.0.0    | 535 KB    | ########## | 100% 
conda-4.8.3          | 2.8 MB    | ########## | 100% 
idna-2.9             | 49 KB     | ########## | 100% 
requests-2.23.0      | 93 KB     | ########## | 100% 
tqdm-4.43.0          | 56 KB     | ########## | 100% 
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate

  added / updated specs:
    - numpy
    - python=3.6


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    blas-1.0                   |              mkl           6 KB
    certifi-2019.11.28         |           py36_0         154 KB
    icc_rt-2019.0.0            |       h0cc432a_1         6.0 MB
    intel-openmp-2020.0        |              166         1.5 MB
    mkl-2020.0                 |              166        98.9 MB
    mkl-service-2.3.0          |   py36hb782905_0         210 KB
    mkl_fft-1.0.15             |   py36h14836fe_0         118 KB
    mkl_random-1.1.0           |   py36h675688f_0         233 KB
    numpy-1.18.1               |   py36h93ca92e_0           6 KB
    numpy-base-1.18.1          |   py36hc3f5095_1         3.8 MB
    pip-20.0.2                 |           py36_1         1.7 MB
    python-3.6.10              |       h9f7ef89_0        15.9 MB
    setuptools-46.0.0          |           py36_0         535 KB
    six-1.14.0                 |           py36_0          27 KB
    wheel-0.34.2               |           py36_0          66 KB
    wincertstore-0.2           |   py36h7fe50ca_0          14 KB
    ------------------------------------------------------------
                                           Total:       129.2 MB

The following NEW packages will be INSTALLED:

  blas               pkgs/main/win-64::blas-1.0-mkl
  certifi            pkgs/main/win-64::certifi-2019.11.28-py36_0
  icc_rt             pkgs/main/win-64::icc_rt-2019.0.0-h0cc432a_1
  intel-openmp       pkgs/main/win-64::intel-openmp-2020.0-166
  mkl                pkgs/main/win-64::mkl-2020.0-166
  mkl-service        pkgs/main/win-64::mkl-service-2.3.0-py36hb782905_0
  mkl_fft            pkgs/main/win-64::mkl_fft-1.0.15-py36h14836fe_0
  mkl_random         pkgs/main/win-64::mkl_random-1.1.0-py36h675688f_0
  numpy              pkgs/main/win-64::numpy-1.18.1-py36h93ca92e_0
  numpy-base         pkgs/main/win-64::numpy-base-1.18.1-py36hc3f5095_1
  pip                pkgs/main/win-64::pip-20.0.2-py36_1
  python             pkgs/main/win-64::python-3.6.10-h9f7ef89_0
  setuptools         pkgs/main/win-64::setuptools-46.0.0-py36_0
  six                pkgs/main/win-64::six-1.14.0-py36_0
  sqlite             pkgs/main/win-64::sqlite-3.31.1-he774522_0
  vc                 pkgs/main/win-64::vc-14.1-h0510ff6_4
  vs2015_runtime     pkgs/main/win-64::vs2015_runtime-14.16.27012-hf0eaf9b_1
  wheel              pkgs/main/win-64::wheel-0.34.2-py36_0
  wincertstore       pkgs/main/win-64::wincertstore-0.2-py36h7fe50ca_0



Downloading and Extracting Packages
wheel-0.34.2         | 66 KB     | ########## | 100% 
blas-1.0             | 6 KB      | ########## | 100% 
mkl-service-2.3.0    | 210 KB    | ########## | 100% 
mkl-2020.0           | 98.9 MB   | ########## | 100% 
icc_rt-2019.0.0      | 6.0 MB    | ########## | 100% 
python-3.6.10        | 15.9 MB   | ########## | 100% 
certifi-2019.11.28   | 154 KB    | ########## | 100% 
numpy-base-1.18.1    | 3.8 MB    | ########## | 100% 
pip-20.0.2           | 1.7 MB    | ########## | 100% 
mkl_fft-1.0.15       | 118 KB    | ########## | 100% 
mkl_random-1.1.0     | 233 KB    | ########## | 100% 
six-1.14.0           | 27 KB     | ########## | 100% 
intel-openmp-2020.0  | 1.5 MB    | ########## | 100% 
setuptools-46.0.0    | 535 KB    | ########## | 100% 
numpy-1.18.1         | 6 KB      | ########## | 100% 
wincertstore-0.2     | 14 KB     | ########## | 100% 
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
#
# To activate this environment, use
#
#     $ conda activate r-reticulate
#
# To deactivate an active environment, use
#
#     $ conda deactivate

* Miniconda has been successfully installed at "C:/Users/jelle/AppData/Local/r-miniconda".

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

# All requested packages already installed.

Collecting torch
  Using cached torch-0.1.2.post2.tar.gz (128 kB)
Collecting transformers==2.4.1
  Using cached transformers-2.4.1-py3-none-any.whl (475 kB)
Collecting pyyaml
  Using cached PyYAML-5.3-cp36-cp36m-win_amd64.whl (215 kB)
Collecting regex!=2019.12.17
  Using cached regex-2020.2.20-cp36-cp36m-win_amd64.whl (272 kB)
Collecting tqdm>=4.27
  Using cached tqdm-4.43.0-py2.py3-none-any.whl (59 kB)
Processing c:\users\jelle\appdata\local\pip\cache\wheels\03\e9\be\8b52f6e7e8c333b56f9440575b4c5eb4d96d27b5d22df5a71e\sacremoses-0.0.38-py3-none-any.whl
Requirement already satisfied, skipping upgrade: numpy in c:\users\jelle\appdata\local\r-miniconda\envs\r-reticulate\lib\site-packages (from transformers==2.4.1) (1.18.1)
Collecting sentencepiece
  Using cached sentencepiece-0.1.85-cp36-cp36m-win_amd64.whl (1.2 MB)
Collecting tokenizers==0.0.11
  Using cached tokenizers-0.0.11-cp36-cp36m-win_amd64.whl (796 kB)
Collecting filelock
  Using cached filelock-3.0.12-py3-none-any.whl (7.6 kB)
Collecting boto3
  Using cached boto3-1.12.23-py2.py3-none-any.whl (128 kB)
Collecting requests
  Using cached requests-2.23.0-py2.py3-none-any.whl (58 kB)
Requirement already satisfied, skipping upgrade: six in c:\users\jelle\appdata\local\r-miniconda\envs\r-reticulate\lib\site-packages (from sacremoses->transformers==2.4.1) (1.14.0)
Collecting joblib
  Using cached joblib-0.14.1-py2.py3-none-any.whl (294 kB)
Collecting click
  Using cached click-7.1.1-py2.py3-none-any.whl (82 kB)
Collecting s3transfer<0.4.0,>=0.3.0
  Using cached s3transfer-0.3.3-py2.py3-none-any.whl (69 kB)
Collecting jmespath<1.0.0,>=0.7.1
  Using cached jmespath-0.9.5-py2.py3-none-any.whl (24 kB)
Collecting botocore<1.16.0,>=1.15.23
  Using cached botocore-1.15.23-py2.py3-none-any.whl (6.0 MB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Using cached urllib3-1.25.8-py2.py3-none-any.whl (125 kB)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in c:\users\jelle\appdata\local\r-miniconda\envs\r-reticulate\lib\site-packages (from requests->transformers==2.4.1) (2019.11.28)
Collecting idna<3,>=2.5
  Using cached idna-2.9-py2.py3-none-any.whl (58 kB)
Collecting chardet<4,>=3.0.2
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting docutils<0.16,>=0.10
  Using cached docutils-0.15.2-py3-none-any.whl (547 kB)
Collecting python-dateutil<3.0.0,>=2.1
  Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Building wheels for collected packages: torch
  Building wheel for torch (setup.py): started
  Building wheel for torch (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jelle\\AppData\\Local\\Temp\\pip-install-62_8ta7y\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\jelle\\AppData\\Local\\Temp\\pip-install-62_8ta7y\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\jelle\AppData\Local\Temp\pip-wheel-6k17_zaf'
       cwd: C:\Users\jelle\AppData\Local\Temp\pip-install-62_8ta7y\torch\
  Complete output (30 lines):
  running bdist_wheel
  running build
  running build_deps
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\jelle\AppData\Local\Temp\pip-install-62_8ta7y\torch\setup.py", line 265, in <module>
      description="Tensors and Dynamic neural networks in Python with strong GPU acceleration",
    File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\site-packages\setuptools\__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\site-packages\wheel\bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\jelle\AppData\Local\Temp\pip-install-62_8ta7y\torch\setup.py", line 51, in run
      from tools.nnwrap import generate_wrappers as generate_nn_wrappers
  ModuleNotFoundError: No module named 'tools.nnwrap'
  ----------------------------------------
  ERROR: Failed building wheel for torch
  Running setup.py clean for torch
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jelle\\AppData\\Local\\Temp\\pip-install-62_8ta7y\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\jelle\\AppData\\Local\\Temp\\pip-install-62_8ta7y\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
       cwd: C:\Users\jelle\AppData\Local\Temp\pip-install-62_8ta7y\torch
  Complete output (2 lines):
  running clean
  error: [Errno 2] No such file or directory: '.gitignore'
  ----------------------------------------
  ERROR: Failed cleaning build dir for torch
Failed to build torch
Installing collected packages: pyyaml, torch, regex, tqdm, joblib, click, sacremoses, sentencepiece, tokenizers, filelock, docutils, urllib3, jmespath, python-dateutil, botocore, s3transfer, boto3, idna, chardet, requests, transformers
    Running setup.py install for torch: started
    Running setup.py install for torch: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jelle\\AppData\\Local\\Temp\\pip-install-62_8ta7y\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\jelle\\AppData\\Local\\Temp\\pip-install-62_8ta7y\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\jelle\AppData\Local\Temp\pip-record-dyqkqt1u\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\Include\torch'
         cwd: C:\Users\jelle\AppData\Local\Temp\pip-install-62_8ta7y\torch\
    Complete output (23 lines):
    running install
    running build_deps
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\jelle\AppData\Local\Temp\pip-install-62_8ta7y\torch\setup.py", line 265, in <module>
        description="Tensors and Dynamic neural networks in Python with strong GPU acceleration",
      File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\site-packages\setuptools\__init__.py", line 144, in setup
        return distutils.core.setup(**attrs)
      File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\jelle\AppData\Local\Temp\pip-install-62_8ta7y\torch\setup.py", line 99, in run
        self.run_command('build_deps')
      File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\jelle\AppData\Local\Temp\pip-install-62_8ta7y\torch\setup.py", line 51, in run
        from tools.nnwrap import generate_wrappers as generate_nn_wrappers
    ModuleNotFoundError: No module named 'tools.nnwrap'
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jelle\\AppData\\Local\\Temp\\pip-install-62_8ta7y\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\jelle\\AppData\\Local\\Temp\\pip-install-62_8ta7y\\torch\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\jelle\AppData\Local\Temp\pip-record-dyqkqt1u\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\jelle\AppData\Local\r-miniconda\envs\r-reticulate\Include\torch' Check the logs for full command output.
Error: Python module BERT was not found.

Detected Python configuration:

python:         C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate/python.exe
libpython:      C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate/python36.dll
pythonhome:     C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate
version:        3.6.10 |Anaconda, Inc.| (default, Jan  7 2020, 15:18:16) [MSC v.1916 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate/Lib/site-packages/numpy
numpy_version:  1.18.1
@rdatasculptor
Copy link
Author

rdatasculptor commented Mar 19, 2020

Yes, I followed the instructions mentioned here https://stackoverflow.com/questions/56859803/modulenotfounderror-no-module-named-tools-nnwrap using https://pytorch.org/get-started/locally/ to generate an installation command. That way torch seemed to be installed correctly. After reinstalling the golgotha and reticulate I got the same error as I had before. So no luck yet.
I used the command:
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

@rdatasculptor
Copy link
Author

So, am I really the only one with this problem? 😊. I am considering posting a SO guestion. Maybe it's not a bug, but problem in one or more of my settings, versions, etc.

@skeydan
Copy link

skeydan commented Apr 14, 2020

Can you do a pip list in the newly configured environment?
In one of the earlier outputs (which probably is obsolete by now) I see

Using cached torch-0.1.2.post2.tar.gz (128 kB)

which for sure looks very old.

I just tried your above steps on my own machine, in a newly created environment, and it works fine for me with PyTorch 1.4.

The packages I ended up with in that env are

boto3           1.12.39   
botocore        1.15.39   
certifi         2020.4.5.1
chardet         3.0.4     
click           7.1.1     
docutils        0.15.2    
filelock        3.0.12    
idna            2.9       
jmespath        0.9.5     
joblib          0.14.1    
numpy           1.18.2    
pip             19.1.1    
python-dateutil 2.8.1     
regex           2020.4.4  
requests        2.23.0    
s3transfer      0.3.3     
sacremoses      0.0.41    
sentencepiece   0.1.85    
setuptools      41.6.0    
six             1.14.0    
tokenizers      0.0.11    
torch           1.4.0     
tqdm            4.45.0    
transformers    2.4.1     
urllib3         1.25.8    

@rdatasculptor
Copy link
Author

rdatasculptor commented Apr 14, 2020

thank you for your response!

the list I have currently, looks like this:

Package                Version
---------------------- -------------------
asn1crypto             1.3.0
certifi                2019.11.28
cffi                   1.14.0
chardet                3.0.4
conda                  4.8.3
conda-package-handling 1.6.0
cryptography           2.8
idna                   2.9
menuinst               1.4.16
mkl-fft                1.0.15
mkl-random             1.1.0
mkl-service            2.3.0
numpy                  1.18.2
olefile                0.46
Pillow                 7.1.1
pip                    20.0.2
pycosat                0.6.3
pycparser              2.20
pyOpenSSL              19.1.0
PySocks                1.7.1
pywin32                227
requests               2.23.0
ruamel-yaml            0.15.87
setuptools             46.1.3.post20200330
six                    1.14.0
torch                  1.4.0
torchvision            0.5.0
tqdm                   4.44.1
urllib3                1.25.8
wheel                  0.34.2
win-inet-pton          1.1.0
wincertstore           0.2

And when I do this:

library(golgotha)
transformer_download_model("bert-base-multilingual-uncased")

It gives this error:

Downloading model to C:/Users/jelle/Documents/Rlibrary/golgotha/models/bert-base-multilingual-uncased
Error: Python module BERT was not found.

Detected Python configuration:

python:         C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate/python.exe
libpython:      C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate/python36.dll
pythonhome:     C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate
version:        3.6.10 |Anaconda, Inc.| (default, Mar 23 2020, 17:58:33) [MSC v.1916 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate/Lib/site-packages/numpy
numpy_version:  1.18.1

Well, I think I missed something obvious in the process somewhere....but haven't figured it out yet.

@skeydan
Copy link

skeydan commented Apr 14, 2020

Can you retry the model download after doing this in the python env

pip install transformers==2.4.1

?

@rdatasculptor
Copy link
Author

With the python env you mean Anaconda right? (sorry for this Python newby question...). when I run that command in Anaconda and I run the R lines again, then is is what I get:

> library(golgotha)
Loading required package: reticulate
- Connecting/Setting up Python using reticulate
- Loading golgotha BERT code
> transformer_download_model("bert-base-multilingual-uncased")
Downloading model to C:/Users/jelle/Documents/Rlibrary/golgotha/models/bert-base-multilingual-uncased
Error: Python module BERT was not found.

Detected Python configuration:

python:         C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate/python.exe
libpython:      C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate/python36.dll
pythonhome:     C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate
version:        3.6.10 |Anaconda, Inc.| (default, Mar 23 2020, 17:58:33) [MSC v.1916 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:/Users/jelle/AppData/Local/r-miniconda/envs/r-reticulate/Lib/site-packages/numpy
numpy_version:  1.18.1

@rdatasculptor
Copy link
Author

Maybe I found something. The R error says the version number is 3.6.10. When I open the anaconda prompt and give the command python --version it gives back Python 3.7.6. So there seem different versions involved. Or do I misinterpret this information?

@skeydan
Copy link

skeydan commented Apr 14, 2020

Yeah, it looks like you have several environments and/or even several condas (Anaconda and Miniconda)? Can you check that?

@rdatasculptor
Copy link
Author

In my menu I see two anaconda's

Anaconda Powershell Prompt (r-miniconda)
Anaconda Prompt (r-miniconda)

They both give Python 3.7.6 when asked for python version.

@rdatasculptor
Copy link
Author

rdatasculptor commented Apr 14, 2020

Okay, I changed the environment to r-reticulate in the prompt and installed pytorch, transformers. Now it seems to work. It seemed I looked in the wrong envirenment all along.
Thanks for your kind help!

@skeydan
Copy link

skeydan commented Apr 15, 2020

You're welcome!

@andy-phy
Copy link

andy-phy commented Jun 2, 2020

Okay, I changed the environment to r-reticulate in the prompt and installed pytorch, transformers. Now it seems to work. It seemed I looked in the wrong envirenment all along.
Thanks for your kind help!

I have the same problem. So how did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants