A walk with fastai2 - Vision - Study Group and Online Lectures Megathread

I have the same error, I changed types to blocks and got another error.
I switched PILImage to ImageBlock and it works. Is PILImage a valid argument?

pets = DataBlock(blocks=(ImageBlock, Category),
                 get_items=get_image_files,
                 splitter=RandomSplitter(),
                 get_y=RegexLabeller(pat = r'/([^/]+)_\d+.*'))
1 Like

PILImage was old syntax :sweat_smile:. (Now it is just ImageBlock). The blocks should be exactly the same as the one before it we used earlier. We’ll see what PILImage is when we do the lower level API next week

1 Like

Ok great!

I’d like some feedback, you can “like” this comment to vote. If we get over 5 then I will make the adjustment. I can extend the lecture part next week to a bit longer and go (briefly) over some techniques for deployment of our models in Render. Let me know if this would be valuable :slight_smile: (more than the course’s version I posed earlier)

Also: notebooks have been adjusted with the issues said earlier, along with the install directions too :slight_smile:

6 Likes

I’ve added two folders to the repository for now, Tabular and Text. These have some examples and may have issues (they are my old notebooks). When the tabular get’s closer I’ll make the course examples, for now look at these @Meditation :slight_smile:

Hi @muellerzr , excellent lesson last night! Based on my own experience deploying models, I’d like to suggest you to use Heroku instead of Render. Render is great , but after a while they start charging on your card. Since we are just helping others to study and learn how to deploy some toy models, I believe Heroku is the best choice. I even have a tutorial created for our Fastai study group Machine Learning Brasília that you can easily translate and share with your students, if you want: https://github.com/weltonrodrigo/fastai-v3/blob/master/tutorial/deploy-do-classificador-fastai.md . Hope it helps.

3 Likes

I also would like to mention that I’m watching the video again and, so far, I noticed two spots where it gets truncated, like on 38:42, for example. Not a big deal, but I just wanted to let you know.

1 Like

Hi @NandoBr ! Thank you very much :slight_smile: I will certainly look into it! The goal was to show how to first test locally, and then follow up with how we deploy on the app and set it all up. I will look at your tutorial as well, thank you!

On truncation: yes, if there’s any other places where it gets too bad let me know and I can re-cover those topics again next week. :slight_smile:

I’ve constrained fastai2 to torchvision<=0.4.2 for the time being, will remove once we have sorted that bug (or have them sorted that bug).

1 Like

For ImageDataBunch if we used the factory methods from_csv or from_folder there is a seed, if i’m not wrong that is for reproducibility. now we set np.random.seed(2) but i don’t see where we are passing it in.
where Is this seed being used?

So it will do the same (more or less) that np.random.seed will do. Hence why we just pas in seed=2 to ImageDataBunch.

Take a peek at the Splitter in the source code here: https://github.com/fastai/fastai2/blob/master/fastai2/vision/data.py#L26 and it may provide answers

And next class I will go over how to swim and navigate it all easily :slight_smile:

Thanks for that, will do

Hi – I am trying to run all the notebooks also locally on a GTX1060 and most of them I can get running.

@sgugger - might this be some version issue?

The MNIST project however gives me grief ;-( with the following error.

RuntimeError: Cannot pickle CUDA storage; try pickling a CUDA tensor instead

This happens in the first learn.lr_find() call. This is after the reporting of the network summary which looks just fine.


The entry into the dump is:


RuntimeError Traceback (most recent call last)
in
----> 1 learn.lr_find()

~\Miniconda3\envs\fastai-py37\lib\site-packages\fastai2\callback\schedule.py in lr_find(self, start_lr, end_lr, num_it, stop_div, show_plot)
194 n_epoch = num_it//len(self.dbunch.train_dl) + 1
195 cb=LRFinder(start_lr=start_lr, end_lr=end_lr, num_it=num_it, stop_div=stop_div)
–> 196 with self.no_logging(): self.fit(n_epoch, cbs=cb)

~\Miniconda3\envs\fastai-py37\lib\site-packages\torch\multiprocessing\reductions.py in reduce_storage(storage)
320 from . import get_sharing_strategy
321 if storage.is_cuda:
–> 322 raise RuntimeError(“Cannot pickle CUDA storage; try pickling a CUDA tensor instead”)
323 elif get_sharing_strategy() == ‘file_system’:
324 metadata = storage.share_filename()

RuntimeError: Cannot pickle CUDA storage; try pickling a CUDA tensor instead

Kind regards

Raynier.

Does the course-v3 MNIST work? https://github.com/fastai/fastai2/blob/master/nbs/course/lesson7-resnet-mnist.ipynb I checked them all awhile ago but something could’ve changed.

I looking into it - I am trying to run through the segmentation project now… I’ll get back with my findings.

Thanks again for the quick follow up!

Quick edit: Just to report that the notebook runs fin in Colab.

René
Vashon Island (WA)

What is the difference between from fastai2.basics import * and from fastai2 import basics ?

Hi muellerzr hope your well.
I was trying to fix the colab/torchvison issue until 03:00 GMT as I ran the lesson one notebook one day earlier in the day, making my own classifier, I couldn’t understand why it wasn’t working

How did you pinpoint torchvision as the issue?

cheers mrfabulous1 :smiley::smiley:

Hi @mrfabulous1! I saw the numerous issues so first I checked the 3 fastai repositories to see if something was pushed. It wasn’t. This then told me it was PyTorch (probably) given it was with the DataLoaders. From there I checked if torch or torchvision had any recent updates in <4 hours from the post, torchvision was the culprit, releasing 0.5.0

2 Likes

HI NandoBr great post!
Your meetup page looks good.
Do you have an english translation for Heroku? Or should I use google translate? :smiley::smiley::laughing::laughing:
I have an Heroku account which I haven’t used in ages so I will host my next classifier on it.

Many Thanks mrfabulous1:grinning::grinning:

Hi muellerzr
Cheers I’ll try smarter not harder next time!
:laughing::laughing:

1 Like