Giter Club home page Giter Club logo

isic2018's People

Contributors

chvlyl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar

isic2018's Issues

Error while train

Hi!
I got error while launch train.py script

Traceback (most recent call last):
  File "train.py", line 394, in <module>
    main()
  File "train.py", line 323, in main
    loss2 = F.binary_cross_entropy_with_logits(outputs_mask_ind1, train_mask_ind)
  File "/nfs/home/nduginets/miniconda3/envs/with_torch/lib/python3.7/site-packages/torch/nn/functional.py", line 2980, in binary_cross_entropy_with_logits
    raise ValueError("Target size ({}) must be the same as input size ({})".format(target.size(), input.size()))
ValueError: Target size (torch.Size([4, 5])) must be the same as input size (torch.Size([20]))

my command

python3 train.py --checkpoint isic_2018_checkpoint/1_multi_task_unet      
--train-test-split-file /nfs/home/nduginets/ISIC2018/data/train_test_id.pickle         
--image-path /mnt/tank/scratch/nduginets/task2_h5/  
--batch-size 4```

Data

Can you please provide your train_test_id.pickle, %s.h5 and %s_attribute_all.h5 files? And also say how data files and masks should be structured.

RuntimeError: max_pool2d_with_indices_out_cuda_frame failed with error code 0

Hi,there are some errors when I test your model.pt。I don't know what I should do.can you help me?

The test code is as follows

image_path="/kaggle/input/isic2018-200-pics/ISIC2018_Task1-2_Training_Input100/"
output_path="/kaggle/working/data"
temp_path="/kaggle/working/temp"
model_weight="/kaggle/input/isicmodelunet/model.pt"
model='UNet16'
model = UNet16(num_classes=5, pretrained='vgg')
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model.to(device)
model = nn.DataParallel(model)
state = torch.load(model_weight)
model.load_state_dict(state['model'])

print('load model weight')

image_ids = sorted([fname.split('/')[-1].split('.')[0] for fname in glob.glob(os.path.join(image_path, '*.jpg'))])
data_set = TestDataset(image_ids, image_path)
test_loader = DataLoader(data_set, batch_size=1, shuffle=False, num_workers=10, pin_memory=False)
for img_id, test_image, W, H in test_loader:
      test_image = test_image.to(device)  # [N, 1, H, W]
      test_image = test_image.permute(0, 3, 1, 2)
      outputs, outputs_mask_ind1, outputs_mask_ind2 = model(test_image)
      break

the error as follows:

load model weight
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-58-cd870e1e196b> in <module>
     19       test_image = test_image.to(device)  # [N, 1, H, W]
     20       test_image = test_image.permute(0, 3, 1, 2)
---> 21       outputs, outputs_mask_ind1, outputs_mask_ind2 = model(test_image)
     22       break
     23 

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    530             result = self._slow_forward(*input, **kwargs)
    531         else:
--> 532             result = self.forward(*input, **kwargs)
    533         for hook in self._forward_hooks.values():
    534             hook_result = hook(self, input, result)

/opt/conda/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py in forward(self, *inputs, **kwargs)
    148         inputs, kwargs = self.scatter(inputs, kwargs, self.device_ids)
    149         if len(self.device_ids) == 1:
--> 150             return self.module(*inputs[0], **kwargs[0])
    151         replicas = self.replicate(self.module, self.device_ids[:len(inputs)])
    152         outputs = self.parallel_apply(replicas, inputs, kwargs)

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    530             result = self._slow_forward(*input, **kwargs)
    531         else:
--> 532             result = self.forward(*input, **kwargs)
    533         for hook in self._forward_hooks.values():
    534             hook_result = hook(self, input, result)

<ipython-input-44-863006fd5294> in forward(self, x)
     65         conv2 = self.conv2(self.pool(conv1))
     66         conv3 = self.conv3(self.pool(conv2))
---> 67         conv4 = self.conv4(self.pool(conv3))
     68         conv5 = self.conv5(self.pool(conv4))
     69         center = self.center(self.pool(conv5))

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    530             result = self._slow_forward(*input, **kwargs)
    531         else:
--> 532             result = self.forward(*input, **kwargs)
    533         for hook in self._forward_hooks.values():
    534             hook_result = hook(self, input, result)

/opt/conda/lib/python3.6/site-packages/torch/nn/modules/pooling.py in forward(self, input)
    139         return F.max_pool2d(input, self.kernel_size, self.stride,
    140                             self.padding, self.dilation, self.ceil_mode,
--> 141                             self.return_indices)
    142 
    143 

/opt/conda/lib/python3.6/site-packages/torch/_jit_internal.py in fn(*args, **kwargs)
    179             return if_true(*args, **kwargs)
    180         else:
--> 181             return if_false(*args, **kwargs)
    182 
    183     if if_true.__doc__ is None and if_false.__doc__ is not None:

/opt/conda/lib/python3.6/site-packages/torch/nn/functional.py in _max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode, return_indices)
    486         stride = torch.jit.annotate(List[int], [])
    487     return torch.max_pool2d(
--> 488         input, kernel_size, stride, padding, dilation, ceil_mode)
    489 
    490 max_pool2d = boolean_dispatch(

RuntimeError: max_pool2d_with_indices_out_cuda_frame failed with error code 0
···

pretrained checkpoints

Hello, thank you for your work!
Would you please provide the pretrained model checkpoints for inference, please?
Thank you in advance, Lucía

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.