Lesson 1 In-Class Discussion ✅

@prajjwal1 how large and are u sure ur using ur gpu? can check with nvidia-smi command

Francisco it looks great! But I get an error in:

download_images(path/file, dest, max_pics=200)


NameError Traceback (most recent call last)
in
----> 1 download_images(path/file, dest, max_pics=200)

NameError: name ‘download_images’ is not defined

…which I would assume means I don’t have the latest fastai version - but I did update the library (twice, just to make sure). I’m on Salamander. Any suggestions?

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

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

1 Like

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

import fastai
fastai.show_install(0)
2 Likes

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!

3 Likes

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

learn.fit_one_cycle(4)

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
learn.fit_one_cycle(1)
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
callbacks=self.callbacks+callbacks)
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:

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

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

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…

Thanks for such a fast reply @fredguth

1 Like

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

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

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

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

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

1 Like

Yes, I’m using the whole GPU RAM.

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

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

You need to install version 1.0.14:

conda install -c fastai fastai

1 Like