Fastai v1 install issues thread

Hmm, yes, it’s a big mess - pytorch has just introduced pytorch-nightly-cpu, which is not pytorch-nightly, so conda dependencies are broken. Thank you for reporting this issue, @tnisonoff - somehow I didn’t think that it’d break.

Any luck with installing just the dependencies:

conda install fastai -c fastai --only-deps

and then installing fastai from source?

While I’m thinking about a possible solution here, perhaps simply use pip install instructions?

got the same error running conda install fastai -c fastai --only-deps

let me try the pip instructions

I’m able to reproduce this. I will post back once I have a solution.

An obvious solution that would work is to create fastai-cpu conda package that depends on pytorch-nightly-cpu. But I’m trying to think of something better.

1 Like

That actually sounds like a pretty great solution to me!

I got it working on my mac with

pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
pip install fastai

I needed to do some googling to find the cpu location of torch_nightly. I can submit a PR to update the README with pip instructions for cpu mode if you’d like! The current README instructions won’t lead to the correct torch_nightly afaict.

2 Likes

Not for the package manager - that would be one more package to manage, mostly duplicated dependencies, et al.

There could have been a much simpler solution: removing dependency on torch - which is fine since we already have separate instructions to installing it. Except we can do it only in pip packages, conda will not let you cheat :frowning:

What we need is for conda to support a dependency with several alternative names, but I doubt this is going to happen any time soon, since what’s happening with pytorch right now is so rare.

Thank you, but no need to, I will update it shortly.

1 Like

Thank you and jeremy for the super fast response here!

1 Like

Hmm, this is odd that it worked, since if I go to https://pytorch.org/get-started/locally/ and select Preview/Mac/No-CUDA it says “# Preview Build Not Yet Available on MacOS.”

Perhaps it’s not stable that they don’t advertise it?

That was my impression. I found it from this website: https://itsfoss.com/pytorch-open-source-ai-framework/

Didn’t look any further into it.

1 Like

Alright, I think I found a way to cheat! @tnisonoff, please try this:

cleanup first:

pip uninstall -y pytorch-nightly-cpu pytorch torchvision torchvision-nightly torchvision-nightly-cpu fastai
conda uninstall -y pytorch-nightly-cpu pytorch torchvision torchvision-nightly torchvision-nightly-cpu fastai

and then:

conda install -c pytorch pytorch-nightly-cpu
conda install -c fastai torchvision-nightly-cpu
conda install -c fastai/label/test fastai

currently the cheating package is in the test label (hidden from -c fastai users), I tested it to install just fine. If you confirm that it works for you, I will release it to all and update the docs.

and if somebody wants to test the the non-cpu pytorch, it’d be:

conda install -c pytorch pytorch-nightly cuda92
conda install -c fastai torchvision-nightly
conda install -c fastai dataclasses fastprogress
conda install -c fastai/label/test fastai

except I’d remove the test label later, so it’d be just -c fastai, and no need for command 3.

2 Likes

hmm i cant get he last conda install to work…

(py37) [tyler-ekseks2] ~/sandbox/asana: conda install -c fastai/label/test fastai
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - fastai
  - dataclasses
  - fastai
  - fastprogress[version='>=0.1.9']

Current channels:
.....

oh, right, dataclasses and fastprogress are in the main channel, i forgot to uninstall those first, so for now please use this:

conda install -c pytorch pytorch-nightly-cpu
conda install -c fastai torchvision-nightly-cpu
conda install -c fastai dataclasses fastprogress
conda install -c fastai/label/test fastai

and once tested and moved into the main channel it’ll get reduced to

conda install -c pytorch pytorch-nightly-cpu
conda install -c fastai torchvision-nightly-cpu
conda install -c fastai fastai

or

conda install -c pytorch pytorch-nightly-cpu
conda install -c fastai torchvision-nightly-cpu fastai

or

conda install -c pytorch -c fastai pytorch-nightly-cpu torchvision-nightly-cpu fastai
1 Like

that worked!

1 Like

Great, 1.0.5 is out, so now you can do for CPU install:

conda install -c pytorch pytorch-nightly-cpu
conda install -c fastai torchvision-nightly-cpu
conda install -c fastai fastai

or for GPU (replace XX with your cuda number 90, 92, etc.):

conda install -c pytorch pytorch-nightly cudaXX
conda install -c fastai torchvision-nightly
conda install -c fastai fastai

Install docs have been updated to reflect that.

3 Likes

We now have 8 different configurations of fastai-v1 builds tested at azure CI: Mac|Linux py3.6|37 conda|pip:

Build Status

Unfortunately all cpu-only, but that’s a good start.

If you know of a free CI service integrated with github with free access to a GPU that would be great. I know we could use AWS/CGE, but that’s not free.

I found CircliCI, which provides limited builds for free, but I’m not sure whether GPU is included in the free package.

2 Likes

and while setting up the CI for macOS, I found a bug in matplotlib, that affected the test suite. So I thought I’d post the workaround here:

  mkdir -p ~/.matplotlib
  echo "backend: TkAgg" >> ~/.matplotlib/matplotlibrc

The error was similar to this one that I copied from the SO post (I no longer have the exact one I had on azure):

>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "//anaconda/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-macosx-10.5-x86_64.egg/matplotlib/pyplot.py", line 98, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "//anaconda/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-macosx-10.5-x86_64.egg/matplotlib/backends/__init__.py", line 28, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "//anaconda/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-macosx-10.5-x86_64.egg/matplotlib/backends/backend_macosx.py", line 21, in <module>
    from matplotlib.backends import _macosx
**RuntimeError**: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends
1 Like

This is what I originally did, using PyPI:
sudo pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu80/torch_nightly.html
sudo pip install fastai

This gets me fastai 0.7.0, torch 0.3.1, torch-nightly 1.0.0.dev20181005

I’m using Python 2.7 on Ubunto 14.04.

Is My System Supported?
the first line says: Python: You need to have python 3.6 or higher

2 Likes

@stas Problem: No longer have access to GPU… cuda available is false…
Report:

platform info : Linux-4.15.0-36-generic-x86_64-with-debian-stretch-sid
distro info : Ubuntu 16.04 Xenial Xerus
python version : 3.6.5
fastai version : 1.0.6.dev0
torch version : 1.0.0.dev20181008
nvidia driver : 396.37
cuda available : False
cuda version : 9.2.148
cudnn version : 7104
cudnn available: True
torch gpu count: 0

Tue Oct 9 17:20:31 2018
±----------------------------------------------------------------------------+
| NVIDIA-SMI 396.37 Driver Version: 396.37 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GT 710 Off | 00000000:01:00.0 N/A | N/A |
| 50% 49C P8 N/A / N/A | 0MiB / 980MiB | N/A Default |
±------------------------------±---------------------±---------------------+
| 1 GeForce GTX 1080 Off | 00000000:02:00.0 Off | N/A |
| 0% 45C P8 6W / 180W | 0MiB / 8119MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 Not Supported |
±----------------------------------------------------------------------------+

  1. a brief summary of the problem:
    NO longer have GPU access (was working fine with previous fastai)
    torch.cuda.is_available() is FALSE (but torch.backends.cudnn.enabled is TRUE.)

conda install -c pytorch pytorch-nightly cuda92
conda install -c fastai torchvision-nightly
conda install -c fastai fastai