Setup questions

Use this topic for any questions related to Chapter 0 of the course.

Hi @sgugger, thank you for the course. Is it advisable to use a dockerized container as a coding environment on a windows machine? Or inside a WSL2 layer? Or does something or the other may create issues later? (Asking because I have faced a lot of issues with NCCL failure while trying to run XGboost et al on a RAPIDS installation on WSL2).

I havenā€™t personally tries on WSL2 but it should work pretty well as long as your GPU is recognized.

2 Likes

Hi, @sgugger!
In order to go through the first code snippet like

from transformers import pipeline
classifier = pipeline("sentiment-analysis")
classifier("I've been waiting for a HuggingFace course my whole life.")

I needed to do the next things after activating the virtual environment:

pip install ipykernel
python -m ipykernel install --user --name=.env

After that I was able to choose needed virtual environment in jupyter notebook and run the code without errors.
Otherwise Iā€™ve had only Python 3 kernel in jupyter notebook and got messages like ā€œModuleNotFoundError: No module named ā€˜transformersā€™ā€ even though I went through all the setup steps and which python and pip list showed expected results (for the first I saw path to the venv python and for second I saw transformers library in the list).

Is it just me or setup chapter doesnā€™t cover all the steps?

P.S. Iā€™m using Windows 10 and Python 3.8.10

The setup does not cover locally installing jupyter notebook, either you are experienced enough to do it yourself, or we recommend using colab. Thatā€™s why those instructions are not included :slight_smile:

2 Likes

When I try running the command ā€œfrom transformers import pipelineā€
section 3 of chapter 1 of the course in colab, I am getting the following error:

OSError                                   Traceback (most recent call last)
<ipython-input-2-69a9fd07ccac> in <module>()
----> 1 from transformers import pipeline

20 frames
/usr/lib/python3.7/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    362 
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:
    366             self._handle = handle

OSError: /usr/local/lib/python3.7/dist-packages/torchaudio/_torchaudio.so: undefined symbol: _ZN2at6detail10noopDeleteEPv

Any idea how to fix it?

It comes from torchaudio, for some reason. Iā€™ve removed that from the deps installed so if you retry to open the notebook on Colab, it should work now.

1 Like

It is working now. Thank you.

1 Like

Thank you for creating this course! :blush:

I am going through the setup doc where it asks to install development version by running the following command.

!pip install transformers[sentencepiece]

Could you explain why we are passing sentencepiece as an extra instead of passing ā€œdevā€ like below

!pip install transformers[dev]

The dev install was broken on Colab for a few days, because there were incompatible versions of torch and torchaudio, so we switch to something lighter.

1 Like