Hello all,
I am trying to get lesson 1 to run (“Image classification with Convolutional Neural Networks”). I am able to train the model (i think) but when I get to the graphs and most_cat-like etc, it then starts failing.
For example, the instruction box:
# 1. A few correct labels at random
plot_val_with_title(rand_by_correct(True), "Correctly classified")
Results in the following output:
Correctly classified
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-57-d7a653989880> in <module>()
1 # 1. A few correct labels at random
----> 2 plot_val_with_title(rand_by_correct(True), "Correctly classified")
<ipython-input-45-0f6ae40ca2b7> in plot_val_with_title(idxs, title)
5 title_probs = [probs[x] for x in idxs]
6 print(title)
----> 7 return plots(imgs, rows=1, titles=title_probs, figsize=(16,8))
~/Documents/fastai/fastai/courses/dl1/fastai/plots.py in plots(ims, figsize, rows, interp, titles, maintitle)
9 if type(ims[0]) is np.ndarray:
10 ims = np.array(ims)
---> 11 if (ims.shape[-1] != 3): ims = ims.transpose((0,2,3,1))
12 f = plt.figure(figsize=figsize)
13 if maintitle is not None:
ValueError: axes don't match array
However, nothing past this seems to work.
Note that trainning does give an error about javascript, but I thought this was all python based.
arch=resnet34
data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz))
learn = ConvLearner.pretrained(arch, data, precompute=True)
learn.fit(0.01, 3)
returns:
Widget Javascript not detected. It may not be installed or enabled properly.
Error rendering Jupyter widget. Widget not found: {"model_id":"ab8447004e2e4fbc9b99cac46d0c3bdc"}
[ 0. 0.04573 0.0266 0.99121]
[ 1. 0.03284 0.02791 0.99023]
[ 2. 0.03425 0.02573 0.99072]
Thank you for any and all help!