Comments (10)
You would encounter this error when the image size from the data loader is not correct. To make sure the assertion go through correctly, you might need to:
- modify the network parameters (self.h) and number of down-samplings, so that the size of the middle features would match up. (in which case you can't exactly load the pre-trained model)
- Modify the input size (cropped size), in which case you can load the model. No matter the size of you input, as long as the cropped size is (300, 375) for rugd and (375, 600) for rellis, you should be fine.
Based on the information, can you figure out the issue more? What kind of data are you using, and what is the shape of the image from the data-loader?
Can you try using the configs provided under trained_models, instead of the ones under configs?
from ganav-offroad.
Thanks for your reply.I did use the config in trained models along with your downloaded pretrained model from https://drive.google.com/drive/folders/1Un-s7S3WjNTLjkhXPnOAK4RoUjL-pibk
Also I changed the default size from (256,256) to (300,375) in the file pytorch2onnx.py.However while debugging I see that the same error pops up due to self.h = 10 and self.w =12 instead of them being 38 and 47 .
Upon inspection I see it happens from line 88 in segmentors/encoder_decoder.py,coming to line 160 in decode_heads/ours_head_class_attn.py,then to line 106 in the same
As I see the image size is (300,375).
from ganav-offroad.
Did you change the size or the cropped_size? You should make sure the cropped size is (300,375).
How it works is that in the config, model.decode_head.strides is an array/tuple, and the self.h and self.w is calculated based on that array(https://github.com/rayguan97/GANav-offroad/blob/main/mmseg/models/decode_heads/ours_head_class_attn.py#L82
). This same array also decided based on the structure of the backbone (number of downsampling and strides.) The code needs to be improve when I find some time.
For a quick solution, just hard code the fmap with desired dimension, but this would not load the pre-trained model well. If the cropped size are the same, it should run without problem. Did you have any issue running the original code and data?
from ganav-offroad.
As far as I can see there are parameters for crop_size in **pytorch2onnx.py.**There is an input size which I think needs to be (300,375) in order to run so that self.h = 38 and self.w = 47 at all the instances.However it turns out to be 10 and 12 in one of the instances.Hardcoding is not helping expected coz the training is running fine.
As I see the crop_size is set to (300,375) in both configs trained_models/rugd_group6/ganav_rugd6.py and
configs/base/datasets/rugd_group6.py
The other files train.py and test.py run absolutely fine.
However the pytorch2onnx.py. does not even work when i use
your pretrained model and config under trained models.
Was this file running succesfully for you?
from ganav-offroad.
I only used train.py and test.py for the code. I did not use pytorch2onnx.py, so I do not have support or experience for this.
Are you saying that in most instance, it works fine but there is one case you have 10, 12? Are the inputs the same size? Could you check whether you added the padding? (which is specified in the config as well.)
from ganav-offroad.
Yes thats correct, there is only one is instance.How did you convert it to ONNX format?How did you deploy this on the robot?
Can you please provide some info on the same?
from ganav-offroad.
from ganav-offroad.
Actually I was planning to deploy it on Jetson Nano.Thats why I needed to export it as ONNX model.Are you also planning to do the same?
from ganav-offroad.
We are not currently working on that platform so I'm not very familiar with the conversion.
from ganav-offroad.
Thank you for your kind support.I am closing this issue.If there is any other issues in future ,I would definitely like share with you
Once again Thank you for your help
from ganav-offroad.
Related Issues (20)
- Check point file HOT 10
- about the training loss become nan HOT 6
- Pre-processing images HOT 2
- AssertionError HOT 8
- Enquiry regarding Performance of Training HOT 14
- how to get segmentation cost map from segmentation results? HOT 1
- Conversion of RUGD and Rellis Datasets To Rugd6 Group & Training HOT 4
- Is the onnx file generated by pytorch2onnx.py quantized? HOT 1
- Welcome update to OpenMMLab 2.0 HOT 1
- Use pretrained ResNet50 model (backbone) on ImageNet.
- L1? L2? L3? HOT 2
- checkpoint error HOT 4
- Output image of the model HOT 5
- ModuleNotFoundError: No module named 'mmcv._ext' HOT 4
- Change of backbone HOT 2
- Training on GOOSE Dataset HOT 3
- rellis folder structure
- output quality HOT 2
- User Guide / Usage HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ganav-offroad.