Coder Social home page Coder Social logo

gaozhitong / mose-auseg Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 1.0 962 KB

The official code repo for the paper "Mixture of Stochastic Experts for Modeling Aleatoric Uncertainty in Segmentation". (ICLR 2023)

Home Page: https://arxiv.org/pdf/2212.07328.pdf

License: Apache License 2.0

Python 100.00%
aleatoric-uncertainty generative-model mixture-of-experts optimal-transport semantic-segmentation uncertainty-estimation stochastic-segmentation

mose-auseg's People

Contributors

gaozhitong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lukaszbinden

mose-auseg's Issues

RuntimeError: The size of tensor a (128) must match the size of tensor b (4) at non-singleton dimension 2

Hi Zhitong

Thanks a lot for releasing the code. I am trying to train the model on LIDC.
After start, an error occurs immediately:

/storage/homefs/lz20w714/anaconda3/envs/mose/lib/python3.8/site-packages/scipy/init.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.24.3
warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
Traceback (most recent call last):
File "main.py", line 50, in
model.train(data)
File "/storage/homefs/lz20w714/git/mose-auseg/engine.py", line 52, in train
self.validate(data)
File "/storage/homefs/lz20w714/git/mose-auseg/engine.py", line 112, in validate
metrics,prediction,prob = self.net.forward(patch_arrangement, masks_arrangement, prob_gt, val = True)
File "/storage/homefs/lz20w714/anaconda3/envs/mose/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 169, in forward
return self.module(*inputs[0], **kwargs[0])
File "/storage/homefs/lz20w714/anaconda3/envs/mose/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/storage/homefs/lz20w714/git/mose-auseg/models/MoSE.py", line 146, in forward
metric = metrics.cal_metrics_batch((pred.argmax(2)).long(), (label).long(), sample_probs, prob_gt,
File "/storage/homefs/lz20w714/git/mose-auseg/utils/metrics.py", line 102, in cal_metrics_batch
d_sy = get_cost_matrix(sample_arr, gt_arr, M, N, d_sy, label_range=label_range)
File "/storage/homefs/lz20w714/git/mose-auseg/utils/metrics.py", line 46, in get_cost_matrix
cij = (dist_fct(sample_arr[:, i, ...], gt_arr[:, j, ...], label_range=label_range))
File "/storage/homefs/lz20w714/git/mose-auseg/utils/metrics.py", line 18, in iou_dist
intersection = torch.sum(m1 * m2, dim=[-1, -2]) # keep batch and class dimension
RuntimeError: The size of tensor a (128) must match the size of tensor b (4) at non-singleton dimension 2

Thanks in advance for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.