2

I have an issue when trying to profile my model. It showed that it can't disable profiler when it is not running.

I have tried many ways, but I could not find how to fix that error. Could someone give me a hint on could I proceed with this?

P/s: Below is the trace of my error. I used fastai library for training the neural network.

RuntimeError                              Traceback (most recent call last)
<ipython-input-11-5fc263f447e9> in <module>
----> 1 lrn.lr_find()
      2 lrn.recorder.plot(suggestion=True)

~\Anaconda3\lib\site-packages\fastai\train.py in lr_find(learn, profiling, start_lr, end_lr, num_it, stop_div, wd)
     41     cb = LRFinder(learn, start_lr, end_lr, num_it, stop_div)
     42     epochs = int(np.ceil(num_it/len(learn.data.train_dl))) * (num_distrib() or 1)
---> 43     learn.fit(epochs, profiling, start_lr, callbacks=[cb], wd=wd)
     44 
     45 def to_fp16(learn:Learner, loss_scale:float=None, max_noskip:int=1000, dynamic:bool=True, clip:float=None,

~\Anaconda3\lib\site-packages\fastai\basic_train.py in fit(self, epochs, profiling, lr, wd, callbacks)
    209         else: self.opt.lr,self.opt.wd = lr,wd
    210         callbacks = [cb(self) for cb in self.callback_fns + listify(defaults.extra_callback_fns)] + listify(callbacks)
--> 211         fit(epochs, profiling, self, metrics=self.metrics, callbacks=self.callbacks+callbacks)
    212 
    213     def create_opt(self, lr:Floats, wd:Floats=0.)->None:

~\Anaconda3\lib\site-packages\fastai\basic_train.py in fit(epochs, profiling, learn, callbacks, metrics)
    108                     print(epoch)
    109                     with torch.autograd.profiler.profile(use_cuda=False) as prof:
--> 110                         loss = loss_batch(learn.model, xb, yb, learn.loss_func, learn.opt, cb_handler)
    111                 else:
    112                     loss = loss_batch(learn.model, xb, yb, learn.loss_func, learn.opt, cb_handler)

~\Anaconda3\lib\site-packages\torch\autograd\profiler.py in __exit__(self, exc_type, exc_val, exc_tb)
    260         if not self.enabled:
    261             return
--> 262         records = torch.autograd._disable_profiler()
    263         self.function_events = EventList(parse_cpu_trace(records))
    264         return False

RuntimeError: can't disable profiler when it's not running```
KHOA LAI
  • 21
  • 3

0 Answers0