Git Product home page Git Product logo

Comments (6)

yyguo0536 avatar yyguo0536 commented on August 21, 2024 1

Hi there, please see the following,

  1. What type of file for input ? Is it 3D file, or 2D slices ?
  • it's 3D file.
  1. What type of medical image can be used ? DICOM, nifti ?
  • nifti file.
  1. What are the dimensions that are allowed ? Is 96 the maximum ?
  • This is depended on your GPU memory. My setting is 128x128x96.
  1. What kind of value should be in the column 'training file' and 'ground_truth' ? and why 24, 48, 96 ?
  • 'training file' is 4D intensity images, and 'ground_truth' is their corresponding segmentations which is used to evaluation.

from svin.

yyguo0536 avatar yyguo0536 commented on August 21, 2024 1

I got it. In line 45 of "net_3d.py", "self.convb = VNetConvBlock(in_channels, out_channels, layers=layers, kernel_sz=k_size, pad=pad_size)" should be "self.convb = NetConvBlock(in_channels, out_channels, layers=layers, kernel_sz=k_size, pad=pad_size)"

from svin.

cyiheng avatar cyiheng commented on August 21, 2024

Thank you for you answer !

For the csv, I should have ask for the motion-net first about the "image" and "annotation" column, what are they suppose to refer ? The same as for "training_file" and "ground_truth" ?

data = pd.read_csv('your training data with scale/4')
training_l = data['image']
label_l = data['annotation']
for i in range(len(training_l)):
    training_rows24.append(training_l[i])
    trainning_label24.append(label_l[i])

And I tried for the motion_net and I get this error actually, maybe you can tell me more about what it expect as input ?
I printed the shape of the combinedimage (first line)

('combinedimage 12', (1, 2, 96, 96, 96))
Traceback (most recent call last):
  File "train_motion.py", line 115, in <module>
    model.optimize_parameters()
  File "/home/yiheng/bacasable/SVIN/motion-net/models/motion_model.py", line 250, in optimize_parameters
    self.forward()
  File "/home/yiheng/bacasable/SVIN/motion-net/models/motion_model.py", line 169, in forward
    self.real96_A2, self.real48_A2, self.real24_A2)
  File "/home/yiheng/anaconda3/envs/svin/lib/python2.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/yiheng/anaconda3/envs/svin/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py", line 150, in forward
    return self.module(*inputs[0], **kwargs[0])
  File "/home/yiheng/anaconda3/envs/svin/lib/python2.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/yiheng/bacasable/SVIN/motion-net/models/net_3d.py", line 263, in forward
    field12_24, field12_48, field12_96 = self.forward_branch(combined12)
  File "/home/yiheng/bacasable/SVIN/motion-net/models/net_3d.py", line 235, in forward_branch
    br1 = self.in_block(combined_image)
  File "/home/yiheng/anaconda3/envs/svin/lib/python2.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/yiheng/bacasable/SVIN/motion-net/models/net_3d.py", line 51, in forward
    out = self.convb(x)
  File "/home/yiheng/anaconda3/envs/svin/lib/python2.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/yiheng/bacasable/SVIN/motion-net/models/vnet.py", line 34, in forward
    out = self.convs[i](out)
  File "/home/yiheng/anaconda3/envs/svin/lib/python2.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/yiheng/anaconda3/envs/svin/lib/python2.7/site-packages/torch/nn/modules/conv.py", line 345, in forward
    return self.conv2d_forward(input, self.weight)
  File "/home/yiheng/anaconda3/envs/svin/lib/python2.7/site-packages/torch/nn/modules/conv.py", line 342, in conv2d_forward
    self.padding, self.dilation, self.groups)
RuntimeError: Expected 4-dimensional input for 4-dimensional weight 24 2 3 3, but got 5-dimensional input of size [1, 2, 96, 96, 96] instead

Thank you in advance again !

from svin.

yyguo0536 avatar yyguo0536 commented on August 21, 2024

Hi, the 'annotation' is the same as the 'groundtruth' for the evaluation.

For your error, can you set "which_model_netG" to "motion"?

from svin.

cyiheng avatar cyiheng commented on August 21, 2024

It was already set to "motion".
I used the line on the main screen of the github.
Here the options below

----------------- Options ---------------
                batchSize: 1                             
                    beta1: 0.5                           
             border_ratio: 0.0277777777778               
          checkpoints_dir: ./save_motion/                	[default: ./checkpoints]
                  classes: [0, 1]                        
           continue_train: False                         
                     crop: None                          
                 dataroot: ./                            	[default: None]
             dataset_mode: aligned                       
             display_freq: 200                           
               display_id: 0                             	[default: 1]
            display_ncols: 4                             
             display_port: 8097                          
           display_server: http://localhost              
          display_winsize: 256                           
              epoch_count: 1                             
               evaluation: False                         
                 fineSize: 256                           
                  gpu_ids: 0                             
                init_gain: 0.02                          
                init_type: normal                        
                 input_nc: 1                             
                  isTrain: True                          	[default: None]
                lambda_L1: 5000.0                        
                 loadSize: 286                           
                       lr: 0.0001                        
           lr_decay_iters: 50                            
                lr_policy: lambda                        
         max_dataset_size: inf                           
                    model: motion                        
                 nThreads: 4                             
               n_layers_D: 3                             
                     name: experiment_name               
                      ndf: 64                            
              net3d_dir_D: ./results/                    
              net3d_dir_G: ./results/                    
                      ngf: 64                            
                    niter: 1000                          
              niter_decay: 1000                          
               no_dropout: False                         
                  no_flip: False                         
                  no_html: False                         
                 no_lsgan: True                          
                     norm: batch                         
                output_nc: 1                             
                    phase: train                         
                pool_size: 0                             
               print_freq: 1                             
           resize_or_crop: resize_and_crop               
                   rotate: 0.0872664625997               
          save_epoch_freq: 10                            
         save_latest_freq: 5000                          
           serial_batches: False                         
                  spacing: None                          
                   suffix:                               
         update_html_freq: 1000                          
                  verbose: False                         
          which_direction: AtoB                          
              which_epoch: latest                        
         which_model_netD: basic                         
         which_model_netG: motion                        	[default: unet_256]
----------------- End -------------------

from svin.

cyiheng avatar cyiheng commented on August 21, 2024

Yes ! Thank you very much !
It works now !

from svin.

Related Issues (9)

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.