Comments (9)
Could u give me a more detailed description of the error
from unet-nested-multiple-classification.
RuntimeError: CUDA error: device-side assert triggered
Traceback (most recent call last):
File "train.py", line 254, in
train_net(net=net, cfg=cfg)
File "train.py", line 142, in train_net
val_score = eval_net(net, val_loader, device, n_val, cfg)
File "train.py", line 210, in eval_net
sub_cross_entropy = F.cross_entropy(pred.unsqueeze(dim=0), true_mask.unsqueeze(dim=0).squeeze(1)).item()
RuntimeError: CUDA error: device-side assert triggered
from unet-nested-multiple-classification.
Your category number is 3, so your label map should only contain 0,1 and 2, but your label map contain something else. Check your label map.
from unet-nested-multiple-classification.
could not get it? Please give more details. Thanks
from unet-nested-multiple-classification.
Check that your label map contains only 0,1, and 2. You can complete the check by running the following program:
import os
import os.path as osp
from tqdm import tqdm
import cv2
import numpy as np
num_classes = 3
mask_dir = "masks"
mask_names = os.listdir(mask_dir)
for mask_name in tqdm(mask_names):
mask_path = osp.join(mask_dir, mask_name)
mask = cv2.imread(mask_path, 0)
h, w = mask.shape[:2]
pix = []
for i in range(0, num_classes):
pix.append(len(np.where(mask==i)[0]))
if sum(pix) != h*w:
print("error: " + mask_name)
from unet-nested-multiple-classification.
when i set the model='Unet',cannot run,could you help to reply me ,thinks
follow is the erros:
Traceback (most recent call last):
File ".\train.py", line 255, in
train_net(net=net, cfg=cfg)
File ".\train.py", line 122, in train_net
loss += criterion(inference_mask, masks)
File "C:\Users\Administrator\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "E:\深度学习\github\unet多分类\unet-nested-multiple-classification-master\losses.py", line 23, in forward
loss = L.lovasz_softmax(out, target)
File "E:\深度学习\github\unet多分类\unet-nested-multiple-classification-master\LovaszSoftmax\pytorch\lovasz_losses.py", line 167, in lovasz_softmax
loss = lovasz_softmax_flat(*flatten_probas(probas, labels, ignore), classes=classes)
File "E:\深度学习\github\unet多分类\unet-nested-multiple-classification-master\LovaszSoftmax\pytorch\lovasz_losses.py", line 190, in lovasz_softmax_flat
raise ValueError('Sigmoid output possible only with 1 class')
ValueError: Sigmoid output possible only with 1 class
from unet-nested-multiple-classification.
不能把category number的类别定义为mask的分割种类呢,即不需要再把mask的颜色种类重新按0,1,2,3这样排序,保留原本的颜色?
from unet-nested-multiple-classification.
不能把category number的类别定义为mask的分割种类呢,即不需要再把mask的颜色种类重新按0,1,2,3这样排序,保留原本的颜色?
可以,但你需要对加载数据的代码做一些修改。
from unet-nested-multiple-classification.
这代码只能运用于图像尺寸一样的数据集吗???
from unet-nested-multiple-classification.
Related Issues (12)
- 预训练模型问题 HOT 1
- Nothing is classified
- 训练有问题吧
- 数据制作问题 HOT 1
- RuntimeError: Sizes of tensors must match except in dimension 2. Got 74 and 75 (The offending index is 0) HOT 2
- 请问如何在inference_color.py中加入iou、mAP等评价标准的计算
- 实例分割效果的问题 HOT 4
- 请问有没有评价指标的代码 HOT 3
- ValueError: Sigmoid output possible only with 1 class HOT 2
- issue in testing HOT 2
- BrokenPipeError: [Errno 32] Broken pipe
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 unet-nested-multiple-classification.