HiLab-git / SSL4MIS

Semi Supervised Learning for Medical Image Segmentation, a collection of literature reviews and code implementations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

test_2D_fully.py

abcxubu opened this issue · comments

Thanks for your wonderful work. When I run the test for the 2D Uncertainty_Rectified_Pyramid_Consistency according to your advice. I met the problem 'Traceback (most recent call last):
File "/home/b417/xb/5_SSL4MIS-master/SSL4MIS-master/code/test_2D_fully.py", line 121, in
metric = Inference(FLAGS)
File "/home/b417/xb/5_SSL4MIS-master/SSL4MIS-master/code/test_2D_fully.py", line 110, in Inference
case, net, test_save_path, FLAGS)
File "/home/b417/xb/5_SSL4MIS-master/SSL4MIS-master/code/test_2D_fully.py", line 64, in test_single_volume
out_main, dim=1), dim=1).squeeze(0)
TypeError: softmax() received an invalid combination of arguments - got (tuple, dim=int), but expected one of:

  • (Tensor input, name dim, *, torch.dtype dtype)
  • (Tensor input, int dim, torch.dtype dtype)'. I do not know how to deal with it. Could you please tell me how to solve it? Thanks in advance
    1
    2
    .

Hi,
I am so sorry to reply to you, not in time, as I am working on a weakly-supervised segmentation project. For this issue, the URPC produces several predictions, you just need to use the full resolution prediction, and ignore others, like this line.
Best,
Xiangde.

Thanks for your wonderful work. When I run the test for the 2D Uncertainty_Rectified_Pyramid_Consistency according to your advice. I met the problem 'Traceback (most recent call last): File "/home/b417/xb/5_SSL4MIS-master/SSL4MIS-master/code/test_2D_fully.py", line 121, in metric = Inference(FLAGS) File "/home/b417/xb/5_SSL4MIS-master/SSL4MIS-master/code/test_2D_fully.py", line 110, in Inference case, net, test_save_path, FLAGS) File "/home/b417/xb/5_SSL4MIS-master/SSL4MIS-master/code/test_2D_fully.py", line 64, in test_single_volume out_main, dim=1), dim=1).squeeze(0) TypeError: softmax() received an invalid combination of arguments - got (tuple, dim=int), but expected one of:

* (Tensor input, name dim, *, torch.dtype dtype)

* (Tensor input, int dim, torch.dtype dtype)'. I do not know how to deal with it. Could you please tell me how to solve it? Thanks in advance
  ![1](https://user-images.githubusercontent.com/25636252/149947463-5b1ac622-70d4-4084-a28e-1b9b610e6c0e.PNG)
  ![2](https://user-images.githubusercontent.com/25636252/149947489-80cd3496-d264-4dc4-9bc2-3c6e9093ea30.PNG)
  .

这个是在 test_2D_fully.py 中 将 if FLAGS.model == "unet_urds" : 改成 if FLAGS.model == "unet_urpc":
这个要根据里面来改
)(K5W_L}KXHTM2O)Z13BFGF