A minute ago this was mentioned in the Lecture You need to delete tmp/ folder and run your code once again (or maybe even just try to reload your
data
object first).
Great Lemme give it a try
This is because it canât find your test directory. In the ImageClassifierData.from_paths
there is an argument called test_name
, the default is None
so you need to provide the path to the test image directory here when you first create data as below. The reason its None by default is because you may want to just train the model without running predictions. If you anticipate that you will want to run predictions on test data then you would usually want to give it the test directory right from the beginning (in this case you wouldnât need to delete the tmp folder).
For example:
data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz), test='input/test')
Oops sorry about that @sermakarevich
I did provide the test name. I was also able to list the test files using:
data.test_dl.dataset.fnames. But even after that, it was still showing the above error
Lets fix this - accept the invitation
Lol, if you canât beat them, join them.
Was able to make it work by restarting the instance. Thanks everyone
i think resnet doesnât have fully connected layers, so it can be size independent, am i right?
YesâŚCorrect. In fact, with FastAI you can use any Network and I believe it builds it as FCN (Fully Convolutional Nets). So there are no dense layers which means the input sizes can be anything.
https://www.kaggle.com/sinkie/keras-data-augmentation-with-multiple-inputs
Iâm working through this problem currently and this code was super helpful.
So what he does with the third piece is has it be the mean of band1 and band2. I am still working on getting a result, but I use quite a bit of this guyâs code for the image preprocessing.
# Process data into images
def process_images(df):
X_band1 = np.array([np.array(band).astype(np.float32).reshape(75, 75) for band in df["band_1"]])
X_band2 = np.array([np.array(band).astype(np.float32).reshape(75, 75) for band in df["band_2"]])
# Merge bands and add another band as the mean of Band 1 and Band 2 (useful for the ImageDataGenerator later)
imgs = np.concatenate([X_band1[:, :, :, np.newaxis]
, X_band2[:, :, :, np.newaxis]
,((X_band1+X_band2)/2)[:, :, :, np.newaxis]], axis=-1)
return imgs
Hello,
Iâve defined a custom CNN class using PyTorch but I would also like to use all the cool functions in fastai library like data augmentations and lr.finder. Is there a way to import a my model class with any fastai way, then use everything as we did in lesson 1 and 2 ?
optim.Adam is too mainstream
Thanks !
Of course. If you can provide more details about what youâve created, ideally with a github link, we can help get it working.
Did you find better results and changes in logloss by using ResNext Model, as jeremy does in the lesson 2 video? Is inception4 better for these kind of results? I am planning to get in the now closed Kaggle Competition known as Fisheries, would like to know more about the models, that work best for that usecase.
I am also very much interested in how custom pytorch model can be used with fastai. I would appreciate a lot if you would share your example.
My logic is simple: the better a model performance on imagenet is the better performance should be on a subset of imagenet classes. You can see here that in terms of accuracy inception_v4 is slightly better than any resnext model. Pasting a header
Thanks for sharing thre link, nice comparison between the accuracy of different models. Does the @
in the columns refer to the number of epochs. Such as Acc@5
refers to the accuracy of the model after 5 epochs?
Also, Is InceptionResNetV2
also available through the FastAI library?
Acc@5 means you credit your model with the right answer if the right class is in the top 5 guesses.
Yep in fastai its named inceptionresnet_2