Hi Aditya,
RandomSplitter is not able to split the train and validation dataset properly from WheatParser. Could you please correct the format ( def filepath(self, o) -> Union[str, Path]:
return self.source / f"{o.image_id}.jpg"
) code from WheatParser class from https://www.kaggle.com/okeaditya/fastaiv2-pytorch-lightning-fasterrcnn
I am Looking into it. cc @lgvaz
I am able to replicate the issue. @lgvaz this was working previously. What is the recent change that we need to adopt ?
Below is the error when running
parser = WheatParser(df, source / "train")
RandomSplitter is working fine.
TypeError: Can't instantiate abstract class WheatParser with abstract methods bboxes, labels
Thanks @rashmimarganiatgithub for the bug !!!
This tutorial is gone way off track. The reason is so much change in the API and our codebase. We would need some changes to make it run https://www.kaggle.com/okeaditya/fastaiv2-pytorch-lightning-fasterrcnn
It might take a while to revamp the kernel to make it work, We need some changes in the model too.
But the wheat parser will be fixed soon.
I have fixed the parser issue @rashmimarganiatgithub . The model might not work coz of a recent update.
The modifications to make it work with the new model API are very simple, can you work on that @oke-aditya ?
Also, you can now use COCOMetric =)
Yep. I will fix it up by tomorrow 馃榾 I was more concerned about parser. But that seems good.
Guess fixing that up will allow us to make use of wheat as an example tutorial. (Again)
Thanks @lgvaz and @oke-aditya for a quick look, waiting for a fix and uprunning kernel to use this library. Please keep me posted only 10 days left to try out your library. Please make it as soon as possible.
@lgvaz looks like that contest is gonna end. I will fix it up and create one for efficient det as well. 馃榾 @rashmimarganiatgithub I am fixing it. I will tag you here once I create a new version. It will be up before today 馃憤
@oke-aditya thanks for the quick response. Will it support for all range of efficientnetB0-B7?
Yes We use ross wightman's implementation of efficient Det. https://github.com/rwightman/efficientdet-pytorch
It supports a variety of backbones. Including all efficient net B0-b7. Also pre trained weights on COCO are available are for some.
I have tried in mantisshrimp once. Max I could train was b4 on Kaggle.
Hey, @rashmimarganiatgithub I have fixed up the notebook and Trained a faster rcnn resnet 152 FPN network too. It might help you to get a good score on LB. FRCNN is really good with Resnet 152 FPN. I have tested this and it works. I am attaching notebook here as well in case it doesn't show up in Kaggle. I have updated on Kaggle as well (if it doesn't show up do let me know) Happy Building. Below is a zip with ipynb code.
Fastaiv2+PyTorch Lightning FasterRCNN.zip
With mantis, you can train on Multiple gpus too. So do try that to win up the competition and best luck 馃憤
I guess we can add that above notebook as advanced guide.
@oke-aditya thanks much. I will now use it for other competition too. Hence I need to understand Randomsplitter. Could you please point me to the codebase.
@oke-aditya thanks for the help
@oke-aditya, Sure, I will keep you posted on the same.
@lgvaz @oke-aditya. Closing this issue. thanks for your good work.
@oke-aditya , can you please provide me mantisshrimp git repro code with .whl file. installing a package using online in contest is prohibited. Can you please make it quick.
Ok so I get the problem. I guess in the competition like Kaggle internet is disabled for submission. For that, you won't be able to install mantisshrimp from github.
Since this is built on PyTorch you don't need the entire repo. I Suggest you train a model with mantisshrimp in a training kernel. Save it in Kaggle datasets. Upload the mantisshrimp code in datasets.
In a new Inference, kernel Instantiate the model as you did while training. You need mantisshrimp codebase for that. load_state_dict() using torch to load the weights. And simply do the inference.
You need to sometihng like this kernel. Even it has an external dependency to submit the code.
I am working to get the .whl file. As of now I am providing a zip of source code. Let me know if this works, I will provide wheel too.
mantisshrimp-master.zip
.whl and .tar.gz
- This has
.whland.tar.gz
dist.zip
thanks much.
@oke-aditya, code is breaking after installing the package here is the error and kernel is shared with you.
Even with !pip install git+git://github.com/lgvaz/mantisshrimp.git command it is breaking
NameError Traceback (most recent call last)
----> 1 from mantisshrimp.models.rcnn.faster_rcnn import *
2 from mantisshrimp.models.rcnn import *
/opt/conda/lib/python3.7/site-packages/mantisshrimp/__init__.py in
----> 1 from mantisshrimp.utils import *
2 from mantisshrimp.core import *
3 from mantisshrimp.parsers import *
4 from mantisshrimp.data import *
5 from mantisshrimp.transforms import *
/opt/conda/lib/python3.7/site-packages/mantisshrimp/utils/__init__.py in
5 from mantisshrimp.utils.download_utils import *
6 from mantisshrimp.utils.data_dir import *
----> 7 from mantisshrimp.utils.soft_dependencies import *
8 from mantisshrimp.utils.capture_stdout import *
/opt/conda/lib/python3.7/site-packages/mantisshrimp/utils/soft_dependencies.py in
2
3 try:
----> 4 import fastai2.vision.all as fastai
5
6 HAS_FASTAI = True
/opt/conda/lib/python3.7/site-packages/fastai2/vision/all.py in
----> 1 from ..basics import *
2 from ..callback.all import *
3 from .augment import *
4 from .core import *
5 from .data import *
/opt/conda/lib/python3.7/site-packages/fastai2/basics.py in
----> 1 from .data.all import *
2 from .optimizer import *
3 from .callback.core import *
4 from .learner import *
5 from .metrics import
/opt/conda/lib/python3.7/site-packages/fastai2/data/all.py in
----> 1 from ..torch_basics import *
2 from .core import *
3 from .load import *
4 from .external import *
5 from .transforms import *
/opt/conda/lib/python3.7/site-packages/fastai2/torch_basics.py in
3 from .torch_imports import *
4 from .torch_core import *
----> 5 from .layers import *
/opt/conda/lib/python3.7/site-packages/fastai2/layers.py in
271
272 # Cell
--> 273 @log_args
274 class BaseLoss():
275 "Same as loss_cls, but flattens input and target."
NameError: name 'log_args' is not defined
@rashmimarganiatgithub have a look at #222. Let us fix it there. I have commented on one of the solutions and why it isn't working as of now.
@rashmimarganiatgithub Can you provide us with a reproducer for the error?
I do not currently understand why you're getting that error, you can maybe provide us with a colab/kaggle notebook that gives the error and then we try to fix it.
This is now being tracked at #222
Most helpful comment
@lgvaz @oke-aditya. Closing this issue. thanks for your good work.