arnab39 / semi-supervised-segmentation-cyclegan Goto Github PK
View Code? Open in Web Editor NEWPytorch implementation of our paper: Revisting Cycle-GAN for semi-supervised segmentation
License: MIT License
Pytorch implementation of our paper: Revisting Cycle-GAN for semi-supervised segmentation
License: MIT License
I downloaded the provided ACDC dataset and when I tried to run the code, I got the following error (channels issue)
Traceback (most recent call last):
File "main.py", line 87, in
main()
File "main.py", line 73, in main
model.train(args)
File "/project/6037231/amitoj/cycleGAN/model.py", line 362, in train
fake_gt = self.Gsi(unl_img.float()) ### having 21 channels
File "/home/amitoj/.local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/project/6037231/amitoj/cycleGAN/arch/generators.py", line 431, in forward
x = self.conv1(x)
File "/home/amitoj/.local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/amitoj/.local/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 343, in forward
return self.conv2d_forward(input, self.weight)
File "/home/amitoj/.local/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 340, in conv2d_forward
self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size 64 3 7 7, expected input[5, 1, 256, 256] to have 3 channels, but got 1 channels instead
Any fix for this or do I need to manually edit all the code?
hello
I have a problem running the program
runntimeerror cudnn_status_not_initialized
Can you tell me how to solve it
dear master
I found the file ckpt_for_Arnab_loss.ckpt is lost ,can you share it on the github?
Thank you very much!
Hello, I found that the ACDC training_gt dataset is corrupted while downloading. Could you please re-upload the dataset?
Hi, I am wondering why you optimize G first, followed by D, which is different from traditional turn. Is there any difference and advantages?
I tried to run the validation file and I have the following error
FileNotFoundError: [Errno 2] No such file or directory: './val_results/unsupervised/generated_labels/patient069_frame01_1.png'
could you please help me in solving the following error?
Hi,
when I use the code and ACDC dataset your provide, I directly run the commands python3 main.py --model 'semisupervised_cycleGAN' --dataset 'acdc' --gpu_ids '6,7' --training True --batch_size 2
, but I got this problem:
Training semi-supervised cycleGAN
------------Number of Parameters---------------
[Network Gsi] Total number of parameters : 42.795 M
-----------------------------------------------
------------Number of Parameters---------------
[Network Gis] Total number of parameters : 42.724 M
[Network Gsi] Total number of parameters : 42.795 M
[Network Di] Total number of parameters : 2.765 M
[Network Ds] Total number of parameters : 2.766 M
-----------------------------------------------
[*] No checkpoint!
Found 808 label images
Found 808 unlabel images
Found 286 val images
learning rate = 0.0002000
Traceback (most recent call last):
File "main.py", line 87, in <module>
main()
File "main.py", line 73, in main
model.train(args)
File "/home/h/paper_code/code_test/Semi-supervised-segmentation-cycleGAN1/model.py", line 361, in train
fake_gt = self.Gsi(unl_img.float()) ### having 21 channels
File "/home/h/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/home/h/paper_code/code_test/Semi-supervised-segmentation-cycleGAN1/arch/generators.py", line 431, in forward
x = self.conv1(x)
File "/home/h/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/home/h/.local/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 345, in forward
return self.conv2d_forward(input, self.weight)
File "/home/h/.local/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 342, in conv2d_forward
self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size 64 3 7 7, expected input[2, 1, 256, 256] to have 3 channels, but got 1 channels instead
It seems like the input channel of the network is 3, but the ACDC img's channel is 1. How should I modify the code? Thank you very much.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:/SemicycleGAN0/Semi-supervised-segmentation-cycleGAN-master/main.py", line 87, in
main()
File "F:/SemicycleGAN0/Semi-supervised-segmentation-cycleGAN-master/main.py", line 73, in main
model.train(args)
File "F:\SemicycleGAN0\Semi-supervised-segmentation-cycleGAN-master\model.py", line 439, in train
fake_gt_discriminator = make_one_hot(fake_gt_discriminator, args.dataset, args.gpu_ids)
File "F:\SemicycleGAN0\Semi-supervised-segmentation-cycleGAN-master\utils.py", line 347, in make_one_hot
one_hot = torch.FloatTensor(labels.size(0), C, labels.size(2), labels.size(3)).zero_()
IndexError: Dimension out of range (expected to be in range of [-3, 2], but got 3)
My dataset n_channel = 2 (cracks or cracks), I like your code training cityscapes in the code, change the n_channels to 2, but the program is running to The Times wrong one_hot tensor input to the model (pictured), I find a solution, the Internet has a cudnn version of the problem, but I can run successful your source code, so I hope to get your help, thank you!
@jizongFox is probably going to finish this.
when i run the command: python main.py --model 'semisupervised_cycleGAN' --dataset 'voc2012' --gpu_ids '1' --training True
the error occurs: main.py: error: argument --dataset: invalid choice: "'voc2012'" (choose from 'voc2012', 'cityscapes', 'acdc')
how can i solve this, please?
Hello, arnab39!
I have a problem for you.
When I run main.py, but I get this error:
Traceback (most recent call last):
File "main.py", line 88, in
main()
File "main.py", line 73, in main
model.train(args)
File "/home/lix/Documents/code/Semi-supervised-segmentation-cycleGAN/model.py", line 443, in train
gen_loss.backward()
File "/home/lix/miniconda3/envs/ptseg/lib/python3.6/site-packages/torch/tensor.py", line 107, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/lix/miniconda3/envs/ptseg/lib/python3.6/site-packages/torch/autograd/init.py", line 93, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
How can I solve this problem?
I am looking forward for your reply!
Thanks!
Hi,
Can you please let me know, whether the results in Table1 corresponding to the validation split or the test split?
Thanks
Training with VOC2012 dataset works fine for me. However, when I change to the cityscapes dataset it seems to have some issue and the machine runs out of memory quickly: This is the exact error message:
RuntimeError: CUDA out of memory. Tried to allocate 34.00 MiB (GPU 0; 23.65 GiB total capacity; 20.35 GiB already allocated; 93.06 MiB free; 22.01 GiB reserved in total by PyTorch)
I am training with a Titan RTX and CUDA 10.1 in virtualenv with the requirements installed given by the github.
Does anyone know how to fix this issue?
Hello, arnab39!
I have a problem for you.
When I run the main.py and use the resnet101 as the generators,
x = self.layer3(x) (in generators.py)
The output of x is nan.
How can I solve this problem?
I am looking forward for your reply!
Thanks!
Hi,
In your project, during the training of D, 'Sample_from_Pool' is used. What is the difference of training D without 'Sample_from_Pool'? Could you give some explaintions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.