Lesson 1 In-Class Discussion ✅

Hi, I just started doing this course. I’m getting this error in the Lesson 1 notebook (on a Windows 10 Anaconda environment):

b should have at least 2 dimensions, but has 1 dimensions instead

I also encountered an error for pat = r’/([^/]+)_\d+.jpg$’ but there was a fix above by @lngy00.

I couldn’t get much further than trying to download ResNet50, switched to Google Colab thanks to seeing this: https://github.com/wilsantow/Fast-AI-Deep-Learning-1/blob/master/lesson1_.ipynb

Checked the FastAI documentation and I see v1 support is only officially for Linux, explains a lot. Will explore using Linux in a bit…

probably you can try access the link by browser, even download it

I have the same issue as you, with win 10, python 3.7.2 fastai lastest.
when I run data.show_batch(rows=3, figsize=(10,10))
I got error
run time error: b should have at least 2 dimensions, but has 1 dimensions instead

i got the same issue, have you fixed it?

When you say you have the latest FastAI @yjweny1 and @sharonwoo - exactly which version? Some people have had issues updating to the latest and have been stuck with earlier versions that give errors like these. Completely removing and adding back Anaconda has helped in some cases. I’m using Win10, Python 3.7.1 and FastAI 1.0.45. Even the original ‘pat’ regex works in this version, as you can see below. Windows can be slower than Linux currently due to some multi threading issues with Pickle - but it is supported for FastAI v1.0.

1 Like

Hi Brian, thank you for your reply.
I am using win10, python 3.7.1, fastai 1.0.38.
After reading your reply, I think probably my fastai version problem, and I tried conda updata fastai, but somehow, it is the lastest version I can use.
I have the issue with origin pat, I try to run your code in my jupyter notebook.

And if I use the pat in my way to fix, it shows the following problem.

Could someone help,plz.
Thank you.

@brismith, sorry I think I replied under your comment, but I am not

As I mentioned @yjweny1 - you may need to start from scratch with a fresh Anaconda install - not just try and upgrade the environment you have. That should get you up to 1.0.45. My code was just the latest lesson1 pets notebook - which was updated very recently.

Hi @brismith, thanks for the informative response. I just used conda (on a Mac) to install fastai in a fresh virtual environment, and that gives me 1.0.34 which is really odd. Will check the Windows version later.

Possible Conda needs updating too - or re-install Anaconda to get it up to date.

Hi guys I think I fixed my last problem by re-install anaconda, and I have got a new problem.
When I try to run the code
from fastai.vision import *
from fastai.metrics import error_rate
it returns:


I am currently using win10, python 3.7.0 and fastai1.0.45.
Could someone help, plz
Thank you

Hi Brian
Thank you for your advise, it worked.

1 Like

When I run Line 30 of the Lesson1 Notebook I get following Error:

RuntimeError: CUDA error: no kernel image is available for execution on the device

When tried Torch first time I had also got a Warning saying OLD GPU, does that mean I can NOT run pytorch and fastai libraries on my current laptop with this NVIDIA GPU ?

UserWarning: 
    Found GPU0 Quadro K1100M which is of cuda capability 3.0.
    PyTorch no longer supports this GPU because it is too old.
    
  warnings.warn(old_gpu_warn % (d, name, major, capability[1]))

Error in Notebook

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-30-66824b983385> in <module>
----> 1 data.show_batch(rows=3, figsize=(7,6))

~\Anaconda3\lib\site-packages\fastai\basic_data.py in show_batch(self, rows, ds_type, **kwargs)
    179     def show_batch(self, rows:int=5, ds_type:DatasetType=DatasetType.Train, **kwargs)->None:
    180         "Show a batch of data in `ds_type` on a few `rows`."
--> 181         x,y = self.one_batch(ds_type, True, True)
    182         n_items = rows **2 if self.train_ds.x._square_show else rows
    183         if self.dl(ds_type).batch_size < n_items: n_items = self.dl(ds_type).batch_size

~\Anaconda3\lib\site-packages\fastai\basic_data.py in one_batch(self, ds_type, detach, denorm, cpu)
    162         w = self.num_workers
    163         self.num_workers = 0
--> 164         try:     x,y = next(iter(dl))
    165         finally: self.num_workers = w
    166         if detach: x,y = to_detach(x,cpu=cpu),to_detach(y,cpu=cpu)

~\Anaconda3\lib\site-packages\fastai\basic_data.py in __iter__(self)
     73     def __iter__(self):
     74         "Process and returns items from `DataLoader`."
---> 75         for b in self.dl: yield self.proc_batch(b)
     76 
     77     @classmethod

~\Anaconda3\lib\site-packages\fastai\basic_data.py in proc_batch(self, b)
     68         "Process batch `b` of `TensorImage`."
     69         b = to_device(b, self.device)
---> 70         for f in listify(self.tfms): b = f(b)
     71         return b
     72 

~\Anaconda3\lib\site-packages\fastai\vision\data.py in _normalize_batch(b, mean, std, do_x, do_y)
     65     x,y = b
     66     mean,std = mean.to(x.device),std.to(x.device)
---> 67     if do_x: x = normalize(x,mean,std)
     68     if do_y and len(y.shape) == 4: y = normalize(y,mean,std)
     69     return x,y

~\Anaconda3\lib\site-packages\fastai\vision\data.py in normalize(x, mean, std)
     55 def normalize(x:TensorImage, mean:FloatTensor,std:FloatTensor)->TensorImage:
     56     "Normalize `x` with `mean` and `std`."
---> 57     return (x-mean[...,None,None]) / std[...,None,None]
     58 
     59 def denormalize(x:TensorImage, mean:FloatTensor,std:FloatTensor, do_x:bool=True)->TensorImage:

RuntimeError: CUDA error: no kernel image is available for execution on the device

Hi @ameyv,

From the error message, my guess is that your card is no longer supported. I also had problems running this tutorial on a 1050Ti.

Perhaps you can try one of the cloud providers suggested in lecture 1? Note Jeremy mentions that he has a card with 11GB of VRAM, and that anything with less than 8GB will probably have a tough time somewhere in lecture 1 also. Unfortunately my 1050Ti only has 4GB so I ended up switching to the cloud. Hope you find something that works soon.

Hi,I have updated my fast.ai(1.046) and re-install my anaconda ,windows server 08 but it still have this bug. All of the guys says new vision has fixed it but it doesn’t work for me. Could u give me some advice, thanks.

I want to ask this question:
I want to use the local tar dataset : oxford-iiit-pet.tar
how can I change the code:
path = untar_data(‘D/oxford-iiit-pet.tar’); path
My internet speed is slow

The Dataset already downloaded in D:/oxford-iiit-pet.tar
so how can I change this code

Just do

path = Path("Path goes here")

Thanks for your prompt reply. :grinning:

1 Like

Just starting the course and really like it so far.
I set up a recommended Azure Standard_NC6 GPU instance, and have a small issue with the notebook_tutorial.

Toward the end I get an error on the doc command, which is a little strange I think.
?ImageDataBunch and ??ImageDataBunch work fine.

doc(ImageDataBunch)

NameError Traceback (most recent call last)
< ipython-input-1-1ca7fede151e > in < module >
----> 1 doc(ImageDataBunch)

NameError: name ‘doc’ is not defined

I’d just like to check the environment is fully configured and running properly before diving in, and little basic issues like this send up a warning to me.

Any clues? ty!

Update/Edit:
As I thought, this is an issue.
I just ran through the code for Lesson1-pets1 and at In[20] there’s a doc command which fails.

doc(interp.plot_top_losses)

NameError Traceback (most recent call last)
< ipython-input-20-a7fe6964f6f7 > in < module >
----> 1 doc(interp.plot_top_losses)

NameError: name ‘doc’ is not defined

So I’d like to get this instance configured properly.

I’m guessing it’s an import issue perhaps, as it’s missing the doc command, but I don’t know what module that resides in. There’s only two imports in the notebook:
from fastai.vision import *
from fastai.metrics import error_rate

Just testing with from fastai.gen_doc import *
returns error:

ModuleNotFoundError Traceback (most recent call last)
in
----> 1 from fastai.gen_doc import *
2 from fastai.vision import *
3 from fastai.metrics import error_rate

/data/anaconda/envs/fastai/lib/python3.6/site-packages/fastai/gen_doc/init.py in
----> 1 from . import gen_notebooks, nbdoc, core, doctest, nbtest

/data/anaconda/envs/fastai/lib/python3.6/site-packages/fastai/gen_doc/gen_notebooks.py in
1 "gen_doc.nbdoc generates notebook documentation from module functions and links to correct places"
----> 2 import pkgutil, inspect, sys,os, importlib,json,enum,warnings,nbformat,re
3 from IPython.core.display import display, Markdown
4 from nbconvert.preprocessors import ExecutePreprocessor
5 from nbformat.sign import NotebookNotary

ModuleNotFoundError: No module named ‘nbformat’