Runtime error for data.show, learner.fit_one_cycle

Hi,
I got runtime error, when:
data.show_batch(rows=1, figsize=(7,7))
and when fit a learner:
learn.fit_one_cycle(1)
RuntimeError: b should have at least 2 dimensions, but has 1 dimensions instead,
any ideas?
thanks,

I got the same error!!
Did you find how to rectify it?

No I didn’t, I think that there might be a general problem with creating a image bunch,

Hi, I updated my fastai version to latest(1.0.45) and the error resolved !!

I tried this without success: :cold_sweat::sob:

How to update fastai? just reinstall?

I updated(just install as initial) to fastai 1.0.48 and the data.show error fixed! but when I run learn.recorder.plot() , I get RuntimeError: CUDA error: device-side assert triggered

I am running latest version of fastai(v1.0.51) and I have some similar problem :confused:

Functions like:
-> show_batch()
-> fit_one_cycle()
-> fit()

Are not working. When I try to run my code I get the following error:
RuntimeError: DataLoader worker (pid 7604) is killed by signal: Unknown signal: 0.

I have tried the following fixes:
-> Updated all of my packages
-> reset num_workers back to 0
-> decrease batch_size to 32

But none of this seems to be working. Thoughts?

The same problem was resolved for me by passing

num_workers=0

to the function that creates your DataBunch. This is important! Pass it to the DataBunch creator, not the function you have problem with. E.g. for the lesson1 of the course-v3 call:

data = ImageDataBunch.from_name_re(path_img, fnames, pat, ds_tfms=get_transforms(), size=224, bs=bs, num_workers=0).normalize(imagenet_stats)

Edit: also call fit_one_cycle(1) with parameter 1 to resolve the issue there.

1 Like

above solution worked for me passing the parameter num_workers=0 like as below
data_clas = TextClasDataBunch.from_df(path=path, train_df=df_train, valid_df=df_valid, test_df=df_test, tokenizer=tokenizer, vocab=hindi_vocab,bs=32,num_workers=0)
(error:File “”, line 1, in
File “C:\Users\Admin\anaconda3\envs\nlp_fastai\lib\multiprocessing\spawn.py”, line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File “C:\Users\Admin\anaconda3\envs\nlp_fastai\lib\multiprocessing\spawn.py”, line 126, in _main
self = reduction.pickle.load(from_parent)
AttributeError: Can’t get attribute ‘HindiTokenizer’ on <module ‘main’ (built-in)>)