Comments (4)
same problem for me, for batches whose labels don't have all possible labels. What's the correct way to use weight?
from pytorch-enet.
All I can say from the error is that your call weight tensor doesn't have the expected dimensions. Quoting the pytorch docs: weight (Tensor, optional) – a manual rescaling weight given to each class. If given, has to be a Tensor of size C
from pytorch-enet.
You should specify the weights of all classes for all batches regardless of which labels are in any specific batch. PyTorch will take the weight corresponding to the class labels that exist itself when computing the loss. See the NLLLoss docs
from pytorch-enet.
if you're a real genius like me, you simply set the wrong number of classes:
class_weights = enet_weighing(train_loader, 3) # whoops - 3 is highest index of a zero-based array, should use 4!
from pytorch-enet.
Related Issues (20)
- dataset folder structure HOT 2
- test IoU is nan HOT 1
- How do I save the segmented images ? HOT 2
- Training with two classes HOT 3
- Transfer learning with a different number of classes as in original HOT 2
- Question about the params and FLOPs of ENet HOT 2
- Problems while using different dataset HOT 5
- the question with output HOT 1
- the question about output shape HOT 9
- save all the images HOT 2
- a question about UpsamplingBottleneck block HOT 4
- generates iou greater than 1 looks like a wrong formulation!
- the question about torch.load() HOT 3
- question about testing the model on an image HOT 1
- Skip connections HOT 1
- Unable to use pre-trained models HOT 1
- Cannot run main.py in test mode - 1only batches of spatial targets supported (3D tensors) HOT 2
- Pytorch-ENet to ONNX failed due to unsupported max_unpool2d HOT 2
- custom dataset tutorial
- 请问该如何训练自己的数据集
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 pytorch-enet.