Fastai v1 install issues thread

You did the right thing by asking here, @dhoa, it was us developers, who broke it for you.

In the future, remember, that an even simpler solution is to just make a new clone of the repo :wink: in which case no git understanding is needed at all.

1 Like

Thatā€™s pretty much how I fix any git issues. I think @sgugger is the same. :slight_smile:

1 Like

Donā€™t be mean, I didnā€™t have to do this for at least ten days :wink: My new personal record ^^

2 Likes

This is exactly what I did :smiley: so I donā€™t heart my head to much. But I want to become a good developper like you guys also, so I ask it anyway, to have something to learn when I have time

This forum give me a very comfortable feeling when I ask question. Nobody judge anyone by asking a simple question, and the admin doesnā€™t let this happen also. We share with each other even some tips that I think rarely found in other places. Perfect environment to learn ! Iā€™m very happy to be part of it.

3 Likes

Iā€™m so freaking glad to see that Iā€™m not the only one who gets in a git bind sometimes.

1 Like

My OS is macOS 10.13.6. Strangely, I just copy and paste your steps above to create a new environment, but never seen fastai-py3.6 in the available kernels.

It just calls it python3. Why do you expect it to be called fastai-py3.6?

jupyter kernelspec list
Available kernels:
  python3    /home/stas/anaconda3/envs/fastai-py3.6/share/jupyter/kernels/python3

and in another conda env itā€™s called the same, but the location is different:

 jupyter kernelspec list
Available kernels:
  python3    /home/stas/anaconda3/envs/pytorch-dev/share/jupyter/kernels/python3

did following my script work for you? did you get the kernel w/o needing to do anything extra?

Will the fast.ai deep learning part 1 course notes work with v1?

it will not. New part one will be happening shortly and that one will.

okay, thanks

Wiki mode has been turned on for the first post so you can edit it to improve it. Thank you.

I updated my fastai v1 library from the github repo just now (previously updated last night and working fine). Now, when I try to call image_data_from_csv, I am told it is not defined:

from fastai import *
from fastai.vision import *

data = image_data_from_csv(...)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-15-d7d8b5020c48> in <module>()
----> 1 data = image_data_from_csv('/root', 
      2     folder='1FhbiyAFNKcIbhL',
      3     test='/root/1FhbiyAFNKcIbhL-test',
      4     csv_labels='T1Mapped.' + trait + '.2col.tsv',
      5     ds_tfms=get_transforms(do_flip=False),

NameError: name 'image_data_from_csv' is not defined

Did the imports get rearranged in the nightly update?

There has been a changed of API as mentioned here. Look at the examples or the docs for more information.

Thanks. Now I am loading ImageDataBunch.from_csv(...) but I wonder if there has been a regression with the front slash / path / division issue:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-21-4ca507aa97d0> in <module>()
      5     ds_tfms=get_transforms(do_flip=False),
      6     bs=128, # Need larger batch size for rarer things (or balance them artificially)
----> 7     size=128)

/app/fastai/fastai/vision/data.py in from_csv(cls, path, folder, sep, csv_labels, valid_pct, fn_col, label_col, test, suffix, header, **kwargs)
    301             header:Optional[Union[int,str]]='infer', **kwargs:Any)->'ImageDataBunch':
    302         "Create from a csv file."
--> 303         df = pd.read_csv(path/csv_labels, header=header)
    304         return cls.from_df(path, df, folder=folder, sep=sep, valid_pct=valid_pct, test=test,
    305                 fn_col=fn_col, label_col=label_col, suffix=suffix, header=header, **kwargs)

TypeError: unsupported operand type(s) for /: 'str' and 'str'

Pass a Path object (by calling Path(path)) for now, weā€™ll add it there soon. Thanks for warning us!

1 Like

Perfect - that worked like a charm. Thank you!

Fixed in master. (Dunno who broke it. It really doesnā€™t matter. Right?)

3 Likes

Looks like there is an issue with spacyā€™s conda package dependencies, to get the newly released fastai-1.0.6 with conda working, I had to:

conda uninstall cymem spacy

and then:

conda install fastai -c fastai

Itā€™s possible that the issue is only mine, since I was installing various versions of cymem a few days ago, trying to fix spacy's faulty 2.0.15 release. So perhaps it doesnā€™t affect anybody else. But the deps are still wrong.

I filed an issue here: https://github.com/explosion/spaCy/issues/2859

edit: the outcome of the issue - for the foreseeable future, until cymem-2 is released on conda, donā€™t mix pip and conda in the same environment when installing fastai due its dependency on spacy.

I had the same problem with spacy,.

Hi Iā€™m having issues running jupyter notebook after installing fastai library on Ubuntu 18.04
Following previous instructions I created a separate conda env and installed packages as such (with cuda9.1):

conda create -y  python=3.6 --name fastai-py3.6
conda activate fastai-py3.6
conda install -y conda
conda install -y pip setuptools
conda install -y -c pytorch pytorch-nightly cuda91
conda install -y -c fastai torchvision-nightly
conda install -y -c fastai fastai
conda uninstall -y fastai
pip install -e .[dev]

I then activated my env and tried to run jupyter:

source activate  fastai-py3.6
jupyter notebook

which raised the following errors:

Traceback (most recent call last):
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/traitlets/traitlets.py", line 528, in get
    value = obj._trait_values[self.name]
KeyError: 'allow_remote_access'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/notebook/notebookapp.py", line 869, in _default_allow_remote
    addr = ipaddress.ip_address(self.ip)
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/ipaddress.py", line 54, in ip_address
    address)
ValueError: '' does not appear to be an IPv4 or IPv6 address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/workfit/anaconda3/envs/fastai-py3.6/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/notebook/notebookapp.py", line 1629, in initialize
    self.init_webapp()
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/notebook/notebookapp.py", line 1379, in init_webapp
    self.jinja_environment_options,
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/notebook/notebookapp.py", line 158, in __init__
    default_url, settings_overrides, jinja_env_options)
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/notebook/notebookapp.py", line 251, in init_settings
    allow_remote_access=jupyter_app.allow_remote_access,
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/traitlets/traitlets.py", line 556, in __get__
    return self.get(obj, cls)
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/traitlets/traitlets.py", line 535, in get
    value = self._validate(obj, dynamic_default())
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/site-packages/notebook/notebookapp.py", line 872, in _default_allow_remote
    for info in socket.getaddrinfo(self.ip, self.port, 0, socket.SOCK_STREAM):
  File "/home/workfit/anaconda3/envs/fastai-py3.6/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

Any idea whatā€™s going on?