Fastai2 on Windows

hello, can you tell me how do you get working on a windows machine with num_workers set to 0? If I set the variable in the dataloader( I hope you are talking about dataloader inside torch/utils folder), I will get error at contractor of_MultiProcessingDataLoaderIter

super(_MultiProcessingDataLoaderIter, self).init(loader)
assert self._num_workers > 0

    if loader.multiprocessing_context is None:
        multiprocessing_context = multiprocessing
    else:
        multiprocessing_context = loader.multiprocessing_context

Can you help me? I got stuck in chapter1 and I just started this course. Can you provide information about the library version that got you running without error?

Thank you in advance.

Window or Not Window? Should this be a question?

What if your computer came with Window:

I think I tried hard with local Win10 in a notebook with
32G RAM, i7CPU, 1050Ti GPU, 250 SSD and 1T HD
Maybe I didn’t try hard enough.

Short answer:
I’ll try something else, rather than running fastai2 in Win10 locally. I may try Vbox with the new release of Ubuntu 20 in a few days.

Long answer, Here I shared my experience:

  1. Virtualbox or other virtual machines with Ubuntu??
    It used to have issues with GPU drivers in Ubuntu 18 in Vbox, but it seems working better in Ubuntu 19.
  2. Running Ubuntu 18(Window Sub Linux), it only allows me to install that in my SSD, which is almost full.
  3. Fastai2 running in the cloud is a general trend. Thus, I am moving to that direction with the Google Cloud Platform.

I would like to optimize my hardware locally, plus the advantage of cloud computing. Any recommendation?

Are you setting it in the way shown below (taken from https://github.com/fastai/fastai2/blob/master/nbs/course/lesson1-pets.ipynb)

dls = ImageDataLoaders.from_name_re(
    path, fnames, pat=r'(.+)_\d+.jpg$', item_tfms=Resize(460), bs=bs,
    batch_tfms=[*aug_transforms(size=224, min_scale=0.75), Normalize.from_stats(*imagenet_stats)],num_workers=0)

as this works for me on windows?

On a separate note I am unable to get this to work with the nlp data loader(https://github.com/fastai/fastai2/blob/master/nbs/course/lesson3-imdb.ipynb). That is setting

imdb_lm = DataBlock(blocks=(TextBlock.from_df('text', is_lm=True,n_workers=0),),
                    get_x=ColReader('text'),
                    splitter=RandomSplitter())

results in the following error

~\Anaconda3\envs\fastai2\lib\site-packages\numpy\lib\shape_base.py in array_split(ary, indices_or_sections, axis)
774 Nsections = int(indices_or_sections)
775 if Nsections <= 0:
–> 776 raise ValueError(‘number sections must be larger than 0.’)
777 Neach_section, extras = divmod(Ntotal, Nsections)
778 section_sizes = ([0] +

ValueError: number sections must be larger than 0.

dls = ImageDataLoaders.from_name_re(
    path, fnames, pat=r'(.+)_\d+.jpg$', item_tfms=Resize(460), bs=bs,
    batch_tfms=[*aug_transforms(size=224, min_scale=0.75), Normalize.from_stats(*imagenet_stats)],num_workers=0)

This worked for me. Thank you very much. :smile:

Has anyone managed to successfully run through lesson-3-imdb (https://github.com/fastai/fastai2/blob/master/nbs/course/lesson3-imdb.ipynb) on windows? I have tried to limit the number of workers in the data loader to 0 in a similar (n_workers instead of num_workers) way as the image data loader however on both linux and windows on the latest version of fastai2 (0.0.16) when I try to use the data loader with n_workers=0 as below

imdb_lm = DataBlock(blocks=(TextBlock.from_df('text', is_lm=True,n_workers=0),),
                    get_x=ColReader('text'),
                    splitter=RandomSplitter())

I get the following error

ValueError: number sections must be larger than 0.

TypeError Traceback (most recent call last)
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/numpy/lib/shape_base.py in array_split(ary, indices_or_sections, axis)
769 # handle array case.
–> 770 Nsections = len(indices_or_sections) + 1
771 div_points = [0] + list(indices_or_sections) + [Ntotal]

TypeError: object of type ‘int’ has no len()

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)
in
3 splitter=RandomSplitter())
4
----> 5 dbunch_lm = imdb_lm.dataloaders(df)

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/data/block.py in dataloaders(self, source, path, verbose, **kwargs)
105
106 def dataloaders(self, source, path=’.’, verbose=False, **kwargs):
–> 107 dsets = self.datasets(source)
108 kwargs = {**self.dls_kwargs, **kwargs, ‘verbose’: verbose}
109 return dsets.dataloaders(path=path, after_item=self.item_tfms, after_batch=self.batch_tfms, **kwargs)

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/data/block.py in datasets(self, source, verbose)
102 splits = (self.splitter or RandomSplitter())(items)
103 pv(f"{len(splits)} datasets of sizes {’,’.join([str(len(s)) for s in splits])}", verbose)
–> 104 return Datasets(items, tfms=self._combine_type_tfms(), splits=splits, dl_type=self.dl_type, n_inp=self.n_inp, verbose=verbose)
105
106 def dataloaders(self, source, path=’.’, verbose=False, **kwargs):

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/data/core.py in init(self, items, tfms, tls, n_inp, dl_type, **kwargs)
278 def init(self, items=None, tfms=None, tls=None, n_inp=None, dl_type=None, **kwargs):
279 super().init(dl_type=dl_type)
–> 280 self.tls = L(tls if tls else [TfmdLists(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
281 self.n_inp = ifnone(n_inp, max(1, len(self.tls)-1))
282

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/data/core.py in (.0)
278 def init(self, items=None, tfms=None, tls=None, n_inp=None, dl_type=None, **kwargs):
279 super().init(dl_type=dl_type)
–> 280 self.tls = L(tls if tls else [TfmdLists(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
281 self.n_inp = ifnone(n_inp, max(1, len(self.tls)-1))
282

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/foundation.py in call(cls, x, args, **kwargs)
39 return x
40
—> 41 res = super().call(
((x,) + args), **kwargs)
42 res._newchk = 0
43 return res

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/data/core.py in init(self, items, tfms, use_list, do_setup, split_idx, train_setup, splits, types, verbose)
216 if do_setup:
217 pv(f"Setting up {self.tfms}", verbose)
–> 218 self.setup(train_setup=train_setup)
219
220 def _new(self, items, split_idx=None, **kwargs):

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/data/core.py in setup(self, train_setup)
232
233 def setup(self, train_setup=True):
–> 234 self.tfms.setup(self, train_setup)
235 if len(self) != 0:
236 x = super().getitem(0) if self.splits is None else super().getitem(self.splits[0])[0]

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/transform.py in setup(self, items, train_setup)
177 tfms = self.fs[:]
178 self.fs.clear()
–> 179 for t in tfms: self.add(t,items, train_setup)
180
181 def add(self,t, items=None, train_setup=False):

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/transform.py in add(self, t, items, train_setup)
180
181 def add(self,t, items=None, train_setup=False):
–> 182 t.setup(items, train_setup)
183 self.fs.append(t)
184

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/transform.py in setup(self, items, train_setup)
76 def setup(self, items=None, train_setup=False):
77 train_setup = train_setup if self.train_setup is None else self.train_setup
—> 78 return self.setups(getattr(items, ‘train’, items) if train_setup else items)
79
80 def _call(self, fn, x, split_idx=None, **kwargs):

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/dispatch.py in call(self, *args, **kwargs)
96 if not f: return args[0]
97 if self.inst is not None: f = MethodType(f, self.inst)
—> 98 return f(*args, **kwargs)
99
100 def get(self, inst, owner):

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/text/core.py in setups(self, dsets)
285 def setups(self, dsets):
286 if not self.mode == ‘df’ or not isinstance(dsets.items, pd.DataFrame): return
–> 287 dsets.items,count = tokenize_df(dsets.items, self.text_cols, rules=self.rules, **self.kwargs)
288 if self.counter is None: self.counter = count
289 return dsets

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/text/core.py in tokenize_df(df, text_cols, n_workers, rules, mark_fields, tok_func, res_col_name, **tok_kwargs)
215 rules = L(ifnone(rules, defaults.text_proc_rules.copy()))
216 texts = _join_texts(df[text_cols], mark_fields=mark_fields)
–> 217 outputs = L(parallel_tokenize(texts, tok_func, rules, n_workers=n_workers, **tok_kwargs)
218 ).sorted().itemgot(1)
219

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/foundation.py in call(cls, x, args, **kwargs)
39 return x
40
—> 41 res = super().call(
((x,) + args), **kwargs)
42 res._newchk = 0
43 return res

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/foundation.py in init(self, items, use_list, match, *rest)
312 if items is None: items = []
313 if (use_list is not None) or not _is_array(items):
–> 314 items = list(items) if use_list else _listify(items)
315 if match is not None:
316 if is_coll(match): match = len(match)

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/foundation.py in _listify(o)
248 if isinstance(o, list): return o
249 if isinstance(o, str) or _is_array(o): return [o]
–> 250 if is_iter(o): return list(o)
251 return [o]
252

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/torch_core.py in parallel_gen(cls, items, n_workers, as_gen, **kwargs)
719 def parallel_gen(cls, items, n_workers=defaults.cpus, as_gen=False, **kwargs):
720 “Instantiate cls in n_workers procs & call each on a subset of items in parallel.”
–> 721 batches = np.array_split(items, n_workers)
722 idx = np.cumsum(0 + L(batches).map(len))
723 queue = Queue()

<array_function internals> in array_split(*args, **kwargs)

~/anaconda3/envs/fastai2/lib/python3.7/site-packages/numpy/lib/shape_base.py in array_split(ary, indices_or_sections, axis)
774 Nsections = int(indices_or_sections)
775 if Nsections <= 0:
–> 776 raise ValueError(‘number sections must be larger than 0.’)
777 Neach_section, extras = divmod(Ntotal, Nsections)
778 section_sizes = ([0] +

ValueError: number sections must be larger than 0.

I just bonked my head on this today on a gcp instance in which fastai2 came preloaded.

Is there any reason pip install --upgrade fastai2 shouldn’t update fastcore based on the dependency checks? (It didn’t.)

We’re still in pre-release mode, the dependency with fastcore is not vesion-tagged (cause we would need to increase it all the time) and we always say in all our instructions to update fastai2 and fastcore together.

2 Likes

Hello, I am not able to open a new topic. Therefore I thought it would be the best option to post my problem here as I am using a windows platform.
I am getting an error msg in python running this code (which is the begining example code in fastai lessons) below, … after installing fastai2 and updating fastcore with pip install fastai2 and pip install fastcore

the code:

from utils import *

from fastai2.vision.all import *

path = untar_data(URLs.PETS)/‘images’

def is_cat(x): return x[0].isupper()

dls = ImageDataLoaders.from_name_func(path, get_image_files(path), valid_pct=0.2, seed=42, label_func=is_cat, item_tfms=Resize(224))

learn = cnn_learner(dls, resnet34, metrics=error_rate)

learn.fine_tune(1)

the error msg:

c:\users\user\appdata\local\programs\python\python38\lib\site-packages\torch\cuda_init_.py:52: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 9010). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at …\c10\cuda\CUDAFunctions.cpp:100.)
return torch._C._cuda_getDeviceCount() > 0
Traceback (most recent call last):
File “C:\Users\user\Desktop\fastai\fastai1.py”, line 5, in
from fastai2.vision.all import *
File “c:\users\user\fastai2\fastai2\vision\all.py”, line 1, in
from …basics import *
File “c:\users\user\fastai2\fastai2\basics.py”, line 1, in
from .data.all import *
File “c:\users\user\fastai2\fastai2\data\all.py”, line 1, in
from …torch_basics import *
File “c:\users\user\fastai2\fastai2\torch_basics.py”, line 5, in
from .layers import *
File “c:\users\user\fastai2\fastai2\layers.py”, line 276, in
@log_args
NameError: name ‘log_args’ is not defined

I have also tried below methods as it is mentioned somewhere in forums. But again the same error msg shows.

git clone https://github.com/fastai/fastai2
cd fastai2
pip install -e ".[dev]"

which installs fastai 0.0.30 version as a result

git clone https://github.com/fastai/fastcore/
cd fastcore
pip install -e ".[dev]"

I would appreciate if you could tell me how to solve this problem.

@Linda, fastai2 is old name and absolute now.
you can check https://github.com/fastai/fastai
try

git clone https://github.com/fastai/fastai
pip install -e “fastai[dev]”

pip install -e “fastai[dev]” from the fastai repo.
not fastai2.

dls = ImageDataLoaders.from_name_func(path, get_image_files(path), valid_pct=0.2, seed=42, label_func=is_cat, item_tfms=Resize(224), num_workers=0)

num_workers=0 has to set 0 for windows. Also you should import fastai not fastai2.

I am happy to inform you that, after making the changes which you have adviced, I have finally got some results.

In the meanwhile, before the results, python gave me some warnings. From the warnings it is understood that I shall update NVIDIA driver… I will check if this is possible with my hardware… After the text there are some other things written in programmatic expressions. I am wondering if I should take any steps to correct anything? Or are they just some explanatory things about the oldish NVIDIA driver? Many thanks.

This is the complete output:

c:\users\user\appdata\local\programs\python\python38\lib\site-packages\torch\cuda_init_.py:52: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 9010). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at …\c10\cuda\CUDAFunctions.cpp:100.)
return torch._C._cuda_getDeviceCount() > 0
c:\users\user\fastai\fastai\callback\hook.py:190: SyntaxWarning: “is not” with a literal. Did you mean “!=”?

epoch train_loss valid_loss error_rate time
0 0.164075 0.022414 0.009472 32:07
epoch train_loss valid_loss error_rate time
0 0.048312 0.010725 0.002706 39:42

Good to hear it’s working.
As you noticed you should check and update your NVIDIA system drivers. Than try to install cuda driver to one of 10.1, 10.2 or 11 it depends on your hardware. As a last step install pytorch with right cuda support e.g. 10.1 version.

Hi! I am facing the same error when creating a dataloader. Have you been able to solve this error?

Blockquote
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py”, line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py”, line 125, in _main
prepare(preparation_data)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py”, line 236, in prepare
_fixup_main_from_path(data[‘init_main_from_path’])
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py”, line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\runpy.py”, line 265, in run_path
return _run_module_code(code, init_globals, run_name,
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\runpy.py”, line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “C:\Users\Morpheus\Documents\Cyber-Dive-App\backend\mia\alerts\alerts_fastaiv2_hf.py”, line 420, in
alertsfinal = alerts_roberta(alerts_df)
File “C:\Users\Morpheus\Documents\Cyber-Dive-App\backend\mia\alerts\alerts_fastaiv2_hf.py”, line 324, in alerts_roberta
dsets = Datasets(df, splits=splits, tfms=[
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastai2\data\core.py”, line 289, in init
self.tls = L(tls if tls else [TfmdLists(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastai2\data\core.py”, line 289, in
self.tls = L(tls if tls else [TfmdLists(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastcore\foundation.py”, line 47, in call
res = super().call(*((x,) + args), **kwargs)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastai2\data\core.py”, line 226, in init
self.setup(train_setup=train_setup)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastai2\data\core.py”, line 242, in setup
self.tfms.setup(self, train_setup)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastcore\transform.py”, line 197, in setup
for t in tfms: self.add(t,items, train_setup)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastcore\transform.py”, line 200, in add
t.setup(items, train_setup)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastcore\transform.py”, line 78, in setup
return self.setups(getattr(items, ‘train’, items) if train_setup else items)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastcore\dispatch.py”, line 99, in call
return f(args, **kwargs)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastai2\text\core.py”, line 285, in setups
dsets.items,count = tokenize_df(dsets.items, self.text_cols, rules=self.rules, **self.kwargs)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastai2\text\core.py”, line 219, in tokenize_df
outputs = L(parallel_tokenize(texts, tok, rules, n_workers=n_workers)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastcore\foundation.py”, line 47, in call
res = super().call(
((x,) + args), **kwargs)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastcore\foundation.py”, line 324, in init
items = list(items) if use_list else _listify(items)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastcore\foundation.py”, line 260, in _listify
if is_iter(o): return list(o)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastcore\utils.py”, line 760, in parallel_gen
yield from run_procs(f, done, L(batches,idx).zip())
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\site-packages\fastcore\utils.py”, line 738, in run_procs
for o in processes: o.start()
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py”, line 121, in start
self._popen = self._Popen(self)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py”, line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py”, line 327, in _Popen
return Popen(process_obj)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\multiprocessing\popen_spawn_win32.py”, line 45, in init
prep_data = spawn.get_preparation_data(process_obj._name)
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py”, line 154, in get_preparation_data
_check_not_importing_main()
File “C:\Users\Morpheus\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py”, line 134, in _check_not_importing_main
raise RuntimeError(’’’
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

Same issue for me, when initializing TextLMDataBunch.from_df()

Most likely, you need to add num_wokers=0 (Required for Windows env)

dls = ImageDataLoaders.from_df(df, PATH_DATA,
                              fn_col="FILENAME", 
                              label_col="LABEL",
                              num_workers = 0,
                              bs=4)

Hi, I am facing a issue and I have a basic (and most probably stupid) query. I am a beginner to FastAI and trying to run it on Windows 10. I have installed it following the instructions on https://docs.fast.ai/ with Anaconda. When trying to train the model with GPU, I am getting out of memory error (probably because GPU memory is only 2 GB). Is there a workaround with this?

Otherwise, is it possible to use FastAI without GPU?

Welcome @shobhit - reducing the batch size (bs) will reduce the amount of GPU memory used, so I’d try that first. Using the CPU will be pretty slow - and I can’t recall how to force this but maybe change the default device?

1 Like

Thank you @brismith , reducing the batch size worked.

I am running the example script and am getting an error.

RuntimeError: cuda runtime error (801) : operation not supported at ..\torch/csrc/generic/StorageSharing.cpp:258

I’ve tried lots of googling but have not been able to find a solution. Any help is appreciated.
Example Script: fastai/dataloader_spawn.py at master · fastai/fastai · GitHub

EDIT: Using Conda and a GTX 1050. I’ve tried installing the cuda drivers liked here, and also not using these drivers as there was no mention of them on the github. Are they necessary?

EDIT 2: Num workers = 0 fixes this, however I can’t figure out how to get multiple workers even though I’m not using Jupyter notebooks.

(ml) C:\Users\Ben\Desktop\Python Scripts\BiomeRecigonition>python Example.py
C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\torch\_tensor.py:1023: UserWarning: torch.solve is deprecated in favor of torch.linalg.solveand will be removed in a future PyTorch release.
torch.linalg.solve has its arguments reversed and does not return the LU factorization.
To get the LU factorization see torch.lu, which can be used with torch.lu_solve or torch.lu_unpack.
X = torch.solve(B, A).solution
should be replaced with
X = torch.linalg.solve(A, B) (Triggered internally at  ..\aten\src\ATen\native\BatchLinearAlgebra.cpp:760.)
  ret = func(*args, **kwargs)
THCudaCheck FAIL file=..\torch/csrc/generic/StorageSharing.cpp line=258 error=801 : operation not supported
Traceback (most recent call last):
  File "C:\Users\Ben\Desktop\Python Scripts\BiomeRecigonition\Example.py", line 37, in <module>
    learn.lr_find()
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\fastai\callback\schedule.py", line 282, in lr_find
    with self.no_logging(): self.fit(n_epoch, cbs=cb)
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\fastai\learner.py", line 221, in fit
    self._with_events(self._do_fit, 'fit', CancelFitException, self._end_cleanup)
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\fastai\learner.py", line 163, in _with_events
    try: self(f'before_{event_type}');  f()
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\fastai\learner.py", line 212, in _do_fit
    self._with_events(self._do_epoch, 'epoch', CancelEpochException)
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\fastai\learner.py", line 163, in _with_events
    try: self(f'before_{event_type}');  f()
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\fastai\learner.py", line 206, in _do_epoch
    self._do_epoch_train()
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\fastai\learner.py", line 198, in _do_epoch_train
    self._with_events(self.all_batches, 'train', CancelTrainException)
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\fastai\learner.py", line 163, in _with_events
    try: self(f'before_{event_type}');  f()
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\fastai\learner.py", line 169, in all_batches
    for o in enumerate(self.dl): self.one_batch(*o)
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\fastai\data\load.py", line 109, in __iter__
    for b in _loaders[self.fake_l.num_workers==0](self.fake_l):
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\torch\utils\data\dataloader.py", line 918, in __init__
    w.start()
  File "C:\Users\Ben\anaconda3\envs\ml\lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
  File "C:\Users\Ben\anaconda3\envs\ml\lib\multiprocessing\context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "C:\Users\Ben\anaconda3\envs\ml\lib\multiprocessing\context.py", line 327, in _Popen
    return Popen(process_obj)
  File "C:\Users\Ben\anaconda3\envs\ml\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Users\Ben\anaconda3\envs\ml\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
  File "C:\Users\Ben\anaconda3\envs\ml\lib\site-packages\torch\multiprocessing\reductions.py", line 247, in reduce_tensor
    event_sync_required) = storage._share_cuda_()
RuntimeError: cuda runtime error (801) : operation not supported at ..\torch/csrc/generic/StorageSharing.cpp:258

(ml) C:\Users\Ben\Desktop\Python Scripts\BiomeRecigonition>Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Ben\anaconda3\envs\ml\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Users\Ben\anaconda3\envs\ml\lib\multiprocessing\spawn.py", line 126, in _main
    self = reduction.pickle.load(from_parent)
EOFError: Ran out of input

without the nvidia cuda drivers then likely when you installed pytorch, it installed the cpu version and not the gpu version. Start Locally | PyTorch

Hi all,

I’m testing my workflow on a Windows machine after previously solely working on Ubuntu and am getting a weird pause when using functions like learn.get_preds() or learn.fit_one_cycle() or learn.lr_find().

The pause is consistently 25 seconds every time a function like that is called. I did not have this issue on Ubuntu. The results are fine, but the pause is driving me crazy! Any idea what could be causing this?

Thanks!