Florian,
Would you please take a look at this error? Thanks.
device
device(type='cuda', index=0)
learn.lr_find()
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-13-d81c6bd29d71> in <module>
----> 1 learn.lr_find()
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/callback/schedule.py in lr_find(self, start_lr, end_lr, num_it, stop_div, show_plot, suggestions)
221 n_epoch = num_it//len(self.dls.train) + 1
222 cb=LRFinder(start_lr=start_lr, end_lr=end_lr, num_it=num_it, stop_div=stop_div)
--> 223 with self.no_logging(): self.fit(n_epoch, cbs=cb)
224 if show_plot: self.recorder.plot_lr_find()
225 if suggestions:
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/learner.py in fit(self, n_epoch, lr, wd, cbs, reset_opt)
190 try:
191 self.epoch=epoch; self('begin_epoch')
--> 192 self._do_epoch_train()
193 self._do_epoch_validate()
194 except CancelEpochException: self('after_cancel_epoch')
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/learner.py in _do_epoch_train(self)
163 try:
164 self.dl = self.dls.train; self('begin_train')
--> 165 self.all_batches()
166 except CancelTrainException: self('after_cancel_train')
167 finally: self('after_train')
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/learner.py in all_batches(self)
141 def all_batches(self):
142 self.n_iter = len(self.dl)
--> 143 for o in enumerate(self.dl): self.one_batch(*o)
144
145 def one_batch(self, i, b):
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/data/load.py in __iter__(self)
97 for b in _loaders[self.fake_l.num_workers==0](self.fake_l):
98 if self.device is not None: b = to_device(b, self.device)
---> 99 yield self.after_batch(b)
100 self.after_iter()
101 if hasattr(self, 'it'): delattr(self, 'it')
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/transform.py in __call__(self, o)
183 self.fs.append(t)
184
--> 185 def __call__(self, o): return compose_tfms(o, tfms=self.fs, split_idx=self.split_idx)
186 def __repr__(self): return f"Pipeline: {' -> '.join([f.name for f in self.fs if f.name != 'noop'])}"
187 def __getitem__(self,i): return self.fs[i]
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/transform.py in compose_tfms(x, tfms, is_enc, reverse, **kwargs)
136 for f in tfms:
137 if not is_enc: f = f.decode
--> 138 x = f(x, **kwargs)
139 return x
140
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastai2/vision/augment.py in __call__(self, b, split_idx, **kwargs)
31 def __call__(self, b, split_idx=None, **kwargs):
32 self.before_call(b, split_idx=split_idx)
---> 33 return super().__call__(b, split_idx=split_idx, **kwargs) if self.do else b
34
35 # Cell
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/transform.py in __call__(self, x, **kwargs)
70 @property
71 def name(self): return getattr(self, '_name', _get_name(self))
---> 72 def __call__(self, x, **kwargs): return self._call('encodes', x, **kwargs)
73 def decode (self, x, **kwargs): return self._call('decodes', x, **kwargs)
74 def __repr__(self): return f'{self.name}: {self.encodes} {self.decodes}'
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/transform.py in _call(self, fn, x, split_idx, **kwargs)
80 def _call(self, fn, x, split_idx=None, **kwargs):
81 if split_idx!=self.split_idx and self.split_idx is not None: return x
---> 82 return self._do_call(getattr(self, fn), x, **kwargs)
83
84 def _do_call(self, f, x, **kwargs):
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/transform.py in _do_call(self, f, x, **kwargs)
85 if not _is_tuple(x):
86 return x if f is None else retain_type(f(x, **kwargs), x, f.returns_none(x))
---> 87 res = tuple(self._do_call(f, x_, **kwargs) for x_ in x)
88 return retain_type(res, x)
89
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/transform.py in <genexpr>(.0)
85 if not _is_tuple(x):
86 return x if f is None else retain_type(f(x, **kwargs), x, f.returns_none(x))
---> 87 res = tuple(self._do_call(f, x_, **kwargs) for x_ in x)
88 return retain_type(res, x)
89
~/anaconda3/envs/fastai2/lib/python3.7/site-packages/fastcore/transform.py in _do_call(self, f, x, **kwargs)
84 def _do_call(self, f, x, **kwargs):
85 if not _is_tuple(x):
---> 86 return x if f is None else retain_type(f(x, **kwargs), x, f.returns_none(x))
87 res = tuple(self._do_call(f, x_, **kwargs) for x_ in x)
88 return retain_type(res, x)
~/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):
<ipython-input-4-ad044bf89bcd> in encodes(self, o)
83 def encodes(self, o: TensorAudio):
84 noise_amp = (0.001*torch.rand(1) * torch.max(o)).to(self.device)
---> 85 o = (o + noise_amp * torch.empty(o.shape).normal_()).to(self.device)
86 return o
87
RuntimeError: expected device cuda:0 but got device cpu
(fastai2) malcolm@PC-GPU:~$ conda list fast
# packages in environment at /home/malcolm/anaconda3/envs/fastai2:
#
# Name Version Build Channel
fastai2 0.0.16 pypi_0 pypi
fastcore 0.1.16 pypi_0 pypi
fastprogress 0.2.3 py_0 conda-forge
fastscript 0.1.4 pypi_0 pypi