Lesson 1 Discussion ✅

(Rick N) #972

…and I can’t find download_images in the fastai doc…

(Francisco Ingham) #975

You do need the latest version of the fastai library and it is not documented yet. Did you run:

conda install -c fastai fastai

What version of the fastai library do you have?

conda list

(Jeremy Howard (Admin)) #976

@lesscomfortable @ricknta to view your lib details best is:

import fastai

(Francisco Ingham) #977

Hi basu. Please don’t tag Jeremy and Rachel unless other people in the forums cannot help you, see Etiquette for Posting to Forums.

Regarding your question, no there is not precompute in fastai v1 yet!

(Amit Kayal) #978

I am trying to run lesson 1 notebook and getting following error in google colab. Can anyone please help me?


ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py”, line 2882, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File “”, line 1, in
File “/usr/local/lib/python3.6/dist-packages/fastai/train.py”, line 19, in fit_one_cycle
learn.fit(cyc_len, max_lr, wd=wd, callbacks=callbacks)
File “/usr/local/lib/python3.6/dist-packages/fastai/basic_train.py”, line 137, in fit
File “/usr/local/lib/python3.6/dist-packages/fastai/basic_train.py”, line 89, in fit
raise e
File “/usr/local/lib/python3.6/dist-packages/fastai/basic_train.py”, line 77, in fit
for xb,yb in progress_bar(data.train_dl, parent=pbar):
File “/usr/local/lib/python3.6/dist-packages/fastprogress/fastprogress.py”, line 65, in iter
for i,o in enumerate(self._gen):
File “/usr/local/lib/python3.6/dist-packages/fastai/basic_data.py”, line 52, in iter
for b in self.dl: yield self.proc_batch(b)
File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py”, line 637, in next
return self._process_next_batch(batch)
File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py”, line 658, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
RuntimeError: Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py”, line 138, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File “/usr/local/lib/python3.6/dist-packages/fastai/torch_core.py”, line 91, in data_collate
return torch.utils.data.dataloader.default_collate(to_data(batch))
File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py”, line 232, in default_collate
return [default_collate(samples) for samples in transposed]
File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py”, line 232, in
return [default_collate(samples) for samples in transposed]
File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py”, line 207, in default_collate
storage = batch[0].storage()._new_shared(numel)
File “/usr/local/lib/python3.6/dist-packages/torch/storage.py”, line 120, in _new_shared
return cls._new_using_fd(size)
RuntimeError: unable to write to file </torch_217_2325047144>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py”, line 1823, in showtraceback
stb = value.render_traceback()
AttributeError: ‘RuntimeError’ object has no attribute ‘render_traceback

During handling of the above exception, another exception occurred:

(ecdrid) #979

It seems like you don’t have enabled write permissions on the directory…

Kindly check the the latest post by Jeremy, you might prefer to run NBS on Colab but imho you can just use GCP via a new Gmail ID if you have already used 300$ credits

(Daniel) #980

Hello Francisco, I tried to download tthe images but I also received :
NameError: name ‘download_images’ is not defined

(Amit Kayal) #981

Thanks a lot for your response. Could you please let me know which post you are referring? I am not also sure in which directory it is trying to write and reason for permission deny…Colab is a free one…I will use free credit with google cloud if colab fails…

(Daniele Galiffa) #982

Thanks for such a fast reply @fredguth

(Amit Kayal) #983

@ecdrid …I have followed the same link to try…Not sure what permission i need to give to avoid this error

(Michael) #984

I would be also very interested to join a drug discovery/biology/chemistry group! :slight_smile:

(Amit Kayal) #985

Thanks to Rahul…I have now set num_workers=0 and learn.fit_one_cycle(4) sems to be working

(Jose Roman) #986

Is there a specific reason as to why we set the seed value to 2 (ex: np.random.seed(2)) ?

(James Juan Whei Tan) #987

so that results are reproducible by anyone else who uses the same seed as you did


Yes, I’m using the whole GPU RAM.

(Sahil KARKHANIS) #989

I got the same error on GCP after the new update. i have the fastai (“1.0.12”) as my version.

(Nikhil) #990

If you have used existing fastai image from market place then probably this is not required.
fastai uses conda for installing libs.

(Francisco Ingham) #991

You need to install version 1.0.14:

conda install -c fastai fastai

(Francisco Ingham) #992

Do you have the latest fastai library (1.0.14)?

(Francisco Ingham) #995

No. A git pull just updates the your local folder with the repository’s contents. We need to update the library which is a package installed in Anaconda. Even if you have the latest fastai repository in your computer, you may have an old version library installed. You either need to run the command I suggested if you are using Anaconda or if using pip:

pip install fastai --upgrade