Developer chat


#465

No this one stays as it is.


(Stas Bekman) #466

despite it returning a learner object, just like the others?


(Piotr Czapla) #467

if you want to keep compatibility, with the recorded videos why not to simply add deprecation warning to create_cnn and pointing ppl to new cnn_learner ?


(Dien Hoa TRUONG) #470

I have just updated the fast.ai library and found a bug when representing learner with data from single_from_classes .
It works perfect but just error in representation (maybe there is a bug in __ repr __ ?)


(Stas Bekman) #471

FYI, we now have a solution for those who don’t want all the fastai dependencies. It’s documented here.


(Sam) #473

In V1>basic_data->DataBunch()>def create(…

there is:

line 93 val_bs = (bs*3)//2

Is this intentional?

My 4GB GPU often went OOM after finishing training loop of an epoch at start of validation. I found this line was the culprit. In my local repo I have made val_bs=bs to overcome this.

Curious why it is the way it is


(RobG) #474

I have found this too, crashing at validation stage, which I hadn’t ever experienced with v0.7
Maybe it is because I am using fp16 quite often and perhaps validation may not (speculation).
You can see it discussed here Different batch_size for train and valid data loaders


(Sam) #475

very interesting. I will leave it at val_bs=bs for the time being until I gather enough courage to bump it up in 10% increments.


(Stas Bekman) #476

Use https://github.com/stas00/ipyexperiments to speed up the bs tune up.

If you have any follow ups about this new tool, please use this thread to discuss it.


(Sam) #477

@stas, Just tried it out ! You are a life-saver !!


(Ignacio Oguiza) #478

Hi Antoine,
Sorry for the late response.
To be honest with you, I don’t have much time, nor the technical skills (I’m not an IT person) to complete this. My intent with the post was just to share an idea on how an autoLRfinder could work.
I’d be happy to collaborate though provinding lr data, and ideas on time series data like this.
If you are willing to mode this forward, please don’t hesitate to take ownership of this. It seems we both came up with the same idea. I was just a bit faster typing it :wink:!
Please, don’t hesitate to contact me if need any help.
Thanks!


(Stas Bekman) #479

Please note that you can organize such ideas to be implemented via:


(Stas Bekman) #480

Heads up: we now have a tool to query gpu stats that fastai can support, it’s pynvml - and it’s now on both pypi and conda. So most likely it’ll soon be used by the fastai core modules (in particular tests) (and included in fastai dependencies). See the doc above for examples of use. It’s super fast!


(Pierre Ouannes) #481

Unless I’m mistaken, there’s currently no method to label a bounding box with text. Would you be interested by something like this ?


#482

There is, you just have to pass classes on top of your bounding boxes and labels.


(Pierre Ouannes) #483

Oh my bad then, sorry about that :slight_smile:


#484

For some reason my update to the docs didn’t fully convert to HTML. You can see it here now.


(Fred Guth) #485

I got an error in basic_train.py line 270 because it is not recognizing table=True,changing the code to remove this from the call, solves the problem.

Is it a bug?


(Fred Guth) #486

Another potential bug:
When I create a DataBunch from a TensorDataset, as in lesson 5, and then try creating an ClassificationInterpretation, it breaks.

interp = ClassificationInterpretation.from_learner(learn)
interp.plot_top_losses(9, figsize=(7,7))

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-33-f4ec02bb4041> in <module>()
      1 interp = ClassificationInterpretation.from_learner(learn)
----> 2 interp.plot_top_losses(9, figsize=(7,7))

~/Code/fastai/fastai/vision/learner.py in plot_top_losses(self, k, largest, figsize)
     96         "Show images in `top_losses` along with their prediction, actual, loss, and probability of predicted class."
     97         tl_val,tl_idx = self.top_losses(k,largest)
---> 98         classes = self.data.classes
     99         rows = math.ceil(math.sqrt(k))
    100         fig,axes = plt.subplots(rows,rows,figsize=figsize)

~/Code/fastai/fastai/basic_data.py in __getattr__(self, k)
     99         return cls(*dls, path=path, device=device, tfms=tfms, collate_fn=collate_fn)
    100 
--> 101     def __getattr__(self,k:int)->Any: return getattr(self.train_dl, k)
    102     def dl(self, ds_type:DatasetType=DatasetType.Valid)->DeviceDataLoader:
    103         "Returns appropriate `Dataset` for validation, training, or test (`ds_type`)."

~/Code/fastai/fastai/basic_data.py in __getattr__(self, k)
     22 
     23     def __len__(self)->int: return len(self.dl)
---> 24     def __getattr__(self,k:str)->Any: return getattr(self.dl, k)
     25 
     26     @property

~/Code/fastai/fastai/basic_data.py in DataLoader___getattr__(dl, k)
      6 __all__ = ['DataBunch', 'DeviceDataLoader', 'DatasetType']
      7 
----> 8 def DataLoader___getattr__(dl, k:str)->Any: return getattr(dl.dataset, k)
      9 DataLoader.__getattr__ = DataLoader___getattr__
     10 

AttributeError: 'TensorDataset' object has no attribute 'classes'

#488

That conversation has already been had on another topic, if you’re not using fastai to create your dataset, don’t expect all fastai functionalities to work on it. Here the problem is that your TensorDataset doesn’t have the classes attribute that ClassificationInterpretation requires.