question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

icnet error (icnet return tuple but not write that logic)

See original GitHub issue

Hi, icnet returned a tuple when training… but when calculating loss, it directly get size from tuple and got this error:

Traceback (most recent call last):
  File "train.py", line 230, in <module>
    train(cfg, writer, logger)
  File "train.py", line 132, in train
    loss = loss_fn(input=outputs, target=labels)
  File "pytorch-semseg/ptsemseg/loss/loss.py", line 10, in cross_entropy2d
    n, c, h, w = input.size()
AttributeError: 'tuple' object has no attribute 'size'

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
adam9500370commented, Nov 22, 2018

Due to high proportion of pixels for background class in the Pascal VOC dataset, if you train the model from scratch, the model might tend to only learn background class. Therefore, you may need to do class balancing to set higher loss weights for the rare classes, or set ignore_index=0 in F.cross_entropy to ignore background class before the model learned for all the other classes.

You can also download the converted Caffe pretrained weights here, and set img_norm=False and version="pascal" arguments in data_loader (due to data preprocessing of original Caffe implementation). Then use larger batch size and smaller learning rate to fine-tune the model on these datasets.

0reactions
HareshKarnancommented, Sep 28, 2019

My network doesn’t seem to learn even after 10000 training iterations. the miou is still at 0.20.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - writing error when nothing returned from tuple within list
I would like my code to write "error" a single time if the user input is not within tup_list. I also don't understand...
Read more >
Returning tuple does not work with mapped tasks · Issue #4824
It works fine if the task is not mapped and either "nout" task annotation parameter is used, or type annotation Tuple is used....
Read more >
Course Descriptions - Montcalm Community College - Acalog ACMS™
Return multiple values from a function via a tuple. Goal 5: Build programs that work with files. Develop programs to read, write, and...
Read more >
Software Approach to Hazard Detection Using On-line Analysis of ...
The research here addresses the problem of improving software safety through ... we introduce the Cnet toolkit and discuss its support for complex...
Read more >
Untitled
However, metrics for assessment of paths and related performance aspects had not been attempted in IPPM when the framework in was written.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found