-
-
Save gilrosenthal/58e9b4f9d562d000d07d7cf0e5dbd840 to your computer and use it in GitHub Desktop.
!pip install fastai | |
!apt-get -qq install -y libsm6 libxext6 && pip install -q -U opencv-python | |
import cv2 | |
from os import path | |
from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag | |
platform = '{}{}-{}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag()) | |
accelerator = 'cu80' if path.exists('/opt/bin/nvidia-smi') else 'cpu' | |
!pip install -q http://download.pytorch.org/whl/{accelerator}/torch-0.3.0.post4-{platform}-linux_x86_64.whl torchvision | |
import torch | |
!pip install Pillow==4.0.0 | |
!pip install image | |
%matplotlib inline | |
from fastai.imports import * |
fast ai version 1.x colab instructions are now in https://github.com/fastai/course-v3/blob/7dfe63de54daf2210f5b23f237e70ee246be5d0c/docs/google_colab_tutorial.md
Thank you @chakming!
【Problem Solved】It wasn't caused by the installation.
I successfully installed fastai 0.7.0 for courses on local Windows 10. I have gone through Lesson 1 notebook without any errors. https://github.com/Nov05/fastai
I also successfully installed fastai 0.7.0 in Google Colab by the following code.
!pip install "fastai==0.7.0"
!apt-get -qq install -y libsm6 libxext6 && pip install -q -U opencv-python
import cv2
from os import path
from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag
platform = '{}{}-{}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag())
accelerator = 'cu80' if path.exists('/opt/bin/nvidia-smi') else 'cpu'
!pip install -q http://download.pytorch.org/whl/{accelerator}/torch-0.3.0.post4-{platform}-linux_x86_64.whl torchvision
!pip install Pillow>=4.1.1
!pip install image
!pip install torchtext==0.2.3
!pip install seaborn --upgrade matplotlib
!pip install seaborn --upgrade pandas
!pip install seaborn --upgrade pillow
!pip install seaborn --upgrade plotly
However I encountered an error when executing a major code block. Here is the notebook that contains the error. https://github.com/Nov05/fastai/blob/master/colab/lesson1_bcolz_error.ipynb
arch=resnet34
data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz))
learn = ConvLearner.pretrained(arch, data, precompute=True)
learn.fit(0.01, 2)
bcolz/carray_ext.pyx in bcolz.carray_ext.carray.__cinit__()
bcolz/carray_ext.pyx in bcolz.carray_ext.carray._open_carray()
OSError: data directory does not exist
Haven't found any solutions online. Could anyone kindly help with this issue? Thanks.
@wontheone1 I'm having the same problem as you mentioned. Did you manage to find a workaround?
Given running the first notebooks still seems a problem, I asked on the forum here.
Unfortunately, the script posted by OP doesn't work anymore. After a lot of trial and error, I was able to run all the code blocks successfully using just the following.
!pip install torchvision==0.1.9
!pip install fastai==0.7.0
!pip install torchtext==0.2.3
!pip install torchvision==0.1.9 !pip install fastai==0.7.0 !pip install torchtext==0.2.3
thanks!! It works for me
Check this link : https://course.fast.ai/start_colab.html
Install the necessary packages :
!curl -s https://course.fast.ai/setup/colab | bash
Saving data files
from google.colab import drive
drive.mount('/content/gdrive', force_remount=True)
root_dir = "/content/gdrive/My Drive/"
base_dir = root_dir + 'fastai-v3/'
Thanks @zeeshansayad
hello guys, I have a problem and that is when i change runtime type the GPU that comes up is Tesla T4 and this GPU doesn't support cuda versions below 10. on the other hand pytorch version 0.3 doesn't support cuda 10. does anyone have an idea what should i do?
Unfortunately, the script posted by OP doesn't work anymore. After a lot of trial and error, I was able to run all the code blocks successfully using just the following.
!pip install torchvision==0.1.9 !pip install fastai==0.7.0 !pip install torchtext==0.2.3
This works fine for me. I add another line, which fixes sklearn
import error as referenced by the official commit to old/fastai (0.7.0)
directory. The complete would be:
!pip install torchvision==0.1.9
!pip install torchtext==0.2.3
!pip install fastai==0.7.0
!sed --in-place '4 c\
from sklearn.preprocessing import LabelEncoder, StandardScaler;from sklearn.impute._base import SimpleImputer as Imputer' /usr/local/lib/python3.6/dist-packages/fastai/structured.py
Paste this script in your cell and run.
in case of fastai version 1.x
for nightly version (https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html)