Lesson 1 In-Class Discussion

(Vikrant Behal) #251

Hi, Pls. keep me posted. I would like to contribute so that students can run the code in CPU mode also.

(Vikrant Behal) #252

Lession1 failing to run on crestle

Ran file: lesson1-crestle.ipynb
Failed at line:


Kindly advise.

(Sanyam Bhutani) #253

The error stack says that you have no Nvidia drivers.
Are you running it in CPU only mode?
Try switching the GPU on?

(Vikrant Behal) #254

GPU is enabled :slight_smile: Pls. check the highlighted text on error image.

(Sanyam Bhutani) #255

I didn’t see that apologies. I’ll try running it on my crestle ID and see.

@vikbehal I was able to run the nb without any errors on crestle.


I am running the course1 nootbook on crestle.
during the below step, the notebook freezes at 0%: Anyone facing this issue?

learn.fit(1e-2, 3, cycle_len=1)

0% 0/3 [00:00<?, ?it/s]

0%| | 0/360 [00:00<?, ?it/s]

(Maureen Metzger) #257

@mprabhu, yes, me too. I switched to AWS and it worked, so not sure what problem is on Crestle.


@memetzgz, thanks for responding. so its related with crestle environment.
How did you setup AWS instance?
As jeremy told we will use AWS from week 2 I haven’t tried it yet.

(Maureen Metzger) #259

@mprabhu, I had set up an Amazon instance previously using the ami from last year’s course. I cloned this year’s repo in, set up a new fastai evironment and it seemed to work, for lesson 1 at least . . .
The archive for last year’s MOOC has the instructions for setting up on AWS here: http://course.fast.ai/lessons/aws.html
It might be safer to wait for the new ami that Jeremy has indicated he is creating? Not sure if it will create problems/conflicts to use the old ami.


@memetzgz hi, i’m finding crestle really slow so trying to set up my aws environment. Can you tell me the type of ami you are using so I can find the same one in my region and begin he setup process? thx

(Ibrahim El-Fayoumi) #261

Anyone got this error?
data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(resnet34, sz))
learn = ConvLearner.pretrained(resnet34, data, precompute=True)
learn.fit(0.01, 1)

AssertionError Traceback (most recent call last)
in ()

~/workspace/fastai/courses/dl1/fastai/conv_learner.py in pretrained(self, f, data, ps, xtra_fc, xtra_cut, **kwargs)
87 def pretrained(self, f, data, ps=None, xtra_fc=None, xtra_cut=0, **kwargs):
88 models = ConvnetBuilder(f, data.c, data.is_multi, data.is_reg, ps=ps, xtra_fc=xtra_fc, xtra_cut=xtra_cut)
—> 89 return self(data, models, **kwargs)
91 @property

~/workspace/fastai/courses/dl1/fastai/conv_learner.py in init(self, data, models, precompute, **kwargs)
80 elif self.metrics is None:
81 self.metrics = [accuracy_multi] if self.data.is_multi else [accuracy]
—> 82 if precompute: self.save_fc1()
83 self.freeze()
84 self.precompute = precompute

~/workspace/fastai/courses/dl1/fastai/conv_learner.py in save_fc1(self)
127 self.fc_data = ImageClassifierData.from_arrays(self.data.path,
128 (act, self.data.trn_y), (val_act, self.data.val_y), self.data.bs, classes=self.data.classes,
–> 129 test = test_act if self.data.test_dl else None, num_workers=8)
131 def freeze(self): self.freeze_to(-self.models.n_fc)

~/workspace/fastai/courses/dl1/fastai/dataset.py in from_arrays(self, path, trn, val, bs, tfms, classes, num_workers, test)
282 @classmethod
283 def from_arrays(self, path, trn, val, bs=64, tfms=(None,None), classes=None, num_workers=4, test=None):
–> 284 datasets = self.get_ds(ArraysIndexDataset, trn, val, tfms, test=test)
285 return self(path, datasets, bs, num_workers, classes=classes)

~/workspace/fastai/courses/dl1/fastai/dataset.py in get_ds(self, fn, trn, val, tfms, test, **kwargs)
266 def get_ds(self, fn, trn, val, tfms, test=None, **kwargs):
267 res = [
–> 268 fn(trn[0], trn[1], tfms[0], **kwargs), # train
269 fn(val[0], val[1], tfms[1], **kwargs), # val
270 fn(trn[0], trn[1], tfms[1], **kwargs), # fix

~/workspace/fastai/courses/dl1/fastai/dataset.py in init(self, x, y, transform)
162 def init(self, x, y, transform):
163 self.x,self.y=x,y
–> 164 assert(len(x)==len(y))
165 super().init(transform)
166 def get_x(self, i):


(Hannan Ali) #262

The first item under the Lesson Resources heading mentions the unedited videos for Section 1 and Section 2 :smile:

(Stephen Lizcano) #263

What Python version are you running?

(Maureen Metzger) #264

Hi @ange, I used the ami from last year’s course, view the getting set up video from last year’s course for details: http://course.fast.ai/lessons/aws.html

(Vikrant Behal) #265



thanks :slight_smile:

anyone get this error when running through this line in the notebook?

from fastai.imports import *

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-4-178e52808742> in <module>()
----> 1 from fastai.imports import *

~/fastai/courses/dl1/fastai/imports.py in <module>()
  1 from IPython.lib.deepreload import reload as dreload
----> 2 import PIL, os, numpy as np, math, collections, cv2, threading, json, bcolz, random, scipy
  3 import random, pandas as pd, pickle, sys, itertools, string, sys, re, datetime
  4 import seaborn as sns, matplotlib
  5 from abc import abstractmethod

ModuleNotFoundError: No module named 'cv2'

 When I try to do pip3 install cv2, I get the error:
 Collecting cv2
 Could not find a version that satisfies the requirement cv2 (from versions: )
 No matching distribution found for cv2

I’m running this within Anaconda 5.0.1, python 3.6


For people who are interested in using Google cloud service - they are providing free cloud service to people having valid credit cards. Also there is a post which I have compiled Lesson 1 using Google Cloud . Feel free to add suggestions in the reply box.

(Santhanam Elumalai) #268

Yeah, you have to install the opencv and other dependent libraries manually, Check this link.
https://anaconda.org/menpo/opencv3. I had the same problem, If will ask you to install another 4 to 6 lib like this, just search in conda cloud for the python3.6 v and install it in your machine.
Make sure you note down all your cmd’s used to install and post it in the forum for further reference. I mistakenly closed the cmd list after the joy of successful run :frowning:


thx @santhanam :slight_smile:

(Santhanam Elumalai) #270

If you experience some dead lock after successful lib installation follow this link, because I am having this issue for now :slight_smile: