Hi there. I am trying lession1.ipynb in Colab, and have encountered a similar error. Haven’t found a solution.
!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
When running the following code, the error occurred.
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)
The full error message is listed as bellow.
OSError Traceback (most recent call last)
<ipython-input-17-e6c87b20ce86> in <module>()
1 arch=resnet34
2 data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz))
----> 3 learn = ConvLearner.pretrained(arch, data, precompute=True)
4 learn.fit(0.01, 2)
/usr/local/lib/python3.6/dist-packages/fastai/conv_learner.py in pretrained(cls, f, data, ps, xtra_fc, xtra_cut, **kwargs)
93 def pretrained(cls, f, data, ps=None, xtra_fc=None, xtra_cut=0, **kwargs):
94 models = ConvnetBuilder(f, data.c, data.is_multi, data.is_reg, ps=ps, xtra_fc=xtra_fc, xtra_cut=xtra_cut)
---> 95 return cls(data, models, **kwargs)
96
97 @property
/usr/local/lib/python3.6/dist-packages/fastai/conv_learner.py in __init__(self, data, models, precompute, **kwargs)
86 elif self.metrics is None:
87 self.metrics = [accuracy_multi] if self.data.is_multi else [accuracy]
---> 88 if precompute: self.save_fc1()
89 self.freeze()
90 self.precompute = precompute
/usr/local/lib/python3.6/dist-packages/fastai/conv_learner.py in save_fc1(self)
128
129 def save_fc1(self):
--> 130 self.get_activations()
131 act, val_act, test_act = self.activations
132 m=self.models.top_model
/usr/local/lib/python3.6/dist-packages/fastai/conv_learner.py in get_activations(self, force)
123 names = [os.path.join(self.tmp_path, p+tmpl) for p in ('x_act', 'x_act_val', 'x_act_test')]
124 if os.path.exists(names[0]) and not force:
--> 125 self.activations = [bcolz.open(p) for p in names]
126 else:
127 self.activations = [self.create_empty_bcolz(self.models.nf,n) for n in names]
/usr/local/lib/python3.6/dist-packages/fastai/conv_learner.py in <listcomp>(.0)
123 names = [os.path.join(self.tmp_path, p+tmpl) for p in ('x_act', 'x_act_val', 'x_act_test')]
124 if os.path.exists(names[0]) and not force:
--> 125 self.activations = [bcolz.open(p) for p in names]
126 else:
127 self.activations = [self.create_empty_bcolz(self.models.nf,n) for n in names]
/usr/local/lib/python3.6/dist-packages/bcolz/toplevel.py in open(rootdir, mode)
138 return bcolz.ctable(rootdir=rootdir, mode=mode)
139 else:
--> 140 return bcolz.carray(rootdir=rootdir, mode=mode)
141
142
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
Would appreciate any help.
For more information: fastai/colab/lesson1_bcolz_error.ipynb at master · Nov05/fastai · GitHub