profile
viewpoint

milesial/Pytorch-UNet 2911

PyTorch implementation of the U-Net for image semantic segmentation with high quality images

MadeInPierre/IA04-Drones 1

Cave Exploration Simulation with Drones (Multi Agent System)

milesial/xfinity-refresh 1

Free pass auto-refresher for xfinity hotspots

utcoupe/obstacle_detector 1

[Forked and adapted for UTCoupe needs] A ROS package for 2D obstacle detection based on laser range data.

milesial/cheat-sheets 0

Cheat sheets on various ML concepts

milesial/DeepQ-Playground 0

Personal experimentation with Deep-Q-Networks for reinforcement learning

milesial/hub 0

Submission to https://pytorch.org/hub/

milesial/pass-rotate 0

A tool and library for rotating your password on online services

issue commentmilesial/Pytorch-UNet

UnpicklingError: invalid load key, '{'.

The problem seems to be with the deserialization or the trained model. I'd suggest you download it again.

mostafiz67

comment created time in 16 hours

issue commentmilesial/Pytorch-UNet

UnpicklingError: invalid load key, '{'.

Which pretrained model are you using? Mine or yours?

mostafiz67

comment created time in 17 hours

issue closedmilesial/Pytorch-UNet

How to perform data Augmentation operations?如何在dataset.py中进行数据增强操作?

我怎样才能在dataset.py中进行数据增强操作?谢谢

closed time in 19 hours

BRWZ

issue commentmilesial/Pytorch-UNet

How to perform data Augmentation operations?如何在dataset.py中进行数据增强操作?

Hi, check out https://pytorch.org/docs/stable/torchvision/transforms.html

BRWZ

comment created time in 19 hours

issue closedmilesial/Pytorch-UNet

why some body said there should not be any batchnorm in Unet?

But this implementation had batchnorm after most conv?

closed time in 19 hours

chenxingshenSecond

issue commentmilesial/Pytorch-UNet

why some body said there should not be any batchnorm in Unet?

This is a customized implementation for the Carvana challenge. Part of the customization includes adding batchnorm layers.

chenxingshenSecond

comment created time in 19 hours

issue commentmilesial/Pytorch-UNet

UnpicklingError: invalid load key, '{'.

Hi, can you show what parameter was passed to --load ? It seems that your checkpoint might be corrupted.

mostafiz67

comment created time in 19 hours

issue closedmilesial/Pytorch-UNet

predict.py: error: the following arguments are required: --input/-i

Thank your code,please help me my error is usage: predict.py [-h] [--model FILE] --input INPUT [INPUT ...] [--output INPUT [INPUT ...]] [--viz] [--no-save] [--mask-threshold MASK_THRESHOLD] [--scale SCALE] predict.py: error: the following arguments are required: --input/-i

closed time in 9 days

MRLQ-Q

issue commentmilesial/Pytorch-UNet

predict.py: error: the following arguments are required: --input/-i

You have to specify your input images. Next time, please read the error messages before opening issues :)

MRLQ-Q

comment created time in 9 days

issue closedmilesial/Pytorch-UNet

inconsistent tensor size

Traceback (most recent call last): File "F:/pycharm/Pytorch-UNet-master/train.py", line 181, in <module> val_percent=args.val / 100) File "F:/pycharm/Pytorch-UNet-master/train.py", line 98, in train_net val_score = eval_net(net, val_loader, device) File "F:\pycharm\Pytorch-UNet-master\eval.py", line 29, in eval_net tot += dice_coeff(pred, true_masks).item() File "F:\pycharm\Pytorch-UNet-master\dice_loss.py", line 40, in dice_coeff s = s + DiceCoeff().forward(c[0], c[1]) File "F:\pycharm\Pytorch-UNet-master\dice_loss.py", line 11, in forward self.inter = torch.dot(input.view(-1), target.view(-1)) RuntimeError: inconsistent tensor size, expected tensor [16384] and src [49152] to have the same number of elements, but got 16384 and 49152 elements respectively

closed time in 19 days

zishuilli

startedDanielRapp/doppler

started time in 19 days

fork milesial/jekyll-klise

🏖 Klisé is a minimalist Jekyll theme for running a personal site or blog, light & dark mode support. (https://klise.now.sh)

https://klise.now.sh

fork in 24 days

issue closedmilesial/Pytorch-UNet

Multi-class issues and discussion

for Multi-class task,mask need encode one_hot ?

closed time in a month

qinxue123321

issue commentmilesial/Pytorch-UNet

Multi-class issues and discussion

Please merge with #15 . You need to encode masks as class-indices

qinxue123321

comment created time in a month

issue commentmilesial/Pytorch-UNet

RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`

Have you tried https://discuss.pytorch.org/t/runtimeerror-cuda-error-cublas-status-alloc-failed-when-calling-cublascreate-handle/78545/7 ?

weiruchenai

comment created time in a month

push eventmilesial/Pytorch-UNet

milesial

commit sha 67bf11b4db4c5f2891bd7e8e7f58bcde8ee2d2db

Pretrained model in the README

view details

push time in a month

startedsamcarter/tikzducks

started time in 2 months

issue commentmilesial/Pytorch-UNet

Help with training

Hi,

  1. merge the overfit issue with this one https://github.com/milesial/Pytorch-UNet/issues/165
  2. On the carvana dataset I used a lr of 2e-6, batch size 1 and from 1 to 5 epochs. It may be different for you, I suggest doing grid-search or random-search on the hyperparameters. Also, did you look at your training loss curve to see if your lr is too low? Last, you may try to change the lr scheduler that might reduce your lr too much.
rohansinghjain

comment created time in 2 months

issue closedmilesial/Pytorch-UNet

something wrong with the network architecture?

Hi, thanks a lot for your work in implementing the code, I have tested your code and the result is amazing. However, when I tried to adjust the model architecture, e.g. add some convtranpose layer, the result is bad, as shown below: 4

I wonder whether it is possible for you to give me some advice or ideas on why the segmentation result will be something like this? Thanks a lot.

closed time in 2 months

wangjk666

issue commentmilesial/Pytorch-UNet

something wrong with the network architecture?

Most often than not you should look at your training algorithm and hyperparameters instead of trying to tweak the architecture itself. I can't really help you more than that I'm sorry, if you choose to modify the architecture you are on your own.

wangjk666

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

something wrong with the network architecture?

Hi, can you describe the changes you made? Did you modify the encoder jointly with the decoder? I can also suggest you to contact the authors of the paper if you want more insight into the architecture choices.

wangjk666

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

Unet model error

Then please detail in your issue that you are only talking about the bilinear case. Also, please search the issues before opening a new one https://github.com/milesial/Pytorch-UNet/issues/69 https://github.com/milesial/Pytorch-UNet/issues/90 https://github.com/milesial/Pytorch-UNet/issues/146

xc769458796

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

Unet only for classification?

For regression you would have to modify the loss to MSE or something else than BCE, and remove the sigmoid/softmax when predicting. You can leave all the other architecture detail as default.

9B8DY6

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

AssertionError: Either no mask or multiple masks found for the ID

  1. does the mask show up when you run ls data/masks/025.* ?
  2. your masks should be 1 channel yes
  3. you can merge that issue with #173 and try answering my comment https://github.com/milesial/Pytorch-UNet/issues/173#issuecomment-664591317
qiuyuan666

comment created time in 2 months

fork milesial/hub

Submission to https://pytorch.org/hub/

fork in 2 months

issue commentmilesial/Pytorch-UNet

pretrained model

Hello everyone, the Carvana model is available in the releases. This was trained for 5 epochs, with scale=1 and bilinear=True. Let me know if you want one with transposed convs.

You can also use torch.hub to load it:

torch.hub.load('milesial/Pytorch-UNet', 'unet_carvana')

More info about torch.hub

QIQIVTrackingY

comment created time in 2 months

push eventmilesial/Pytorch-UNet

milesial

commit sha 4ce26d9d02760fead8fa34445f0e01acf9e4efef

Torch hub

view details

push time in 2 months

created tagmilesial/Pytorch-UNet

tagv1.0

PyTorch implementation of the U-Net for image semantic segmentation with high quality images

created time in 2 months

release milesial/Pytorch-UNet

v1.0

released time in 2 months

push eventmilesial/Pytorch-UNet

milesial

commit sha 4ad8323b2e54c7bbcf8968ca7fc0f2e3ddd87689

Carvana dataset loader

view details

push time in 2 months

issue commentmilesial/Pytorch-UNet

Process finished with exit code -1073741819 (0xC0000005)

For RAM, htop or top. For VRAM, nvidia-smi.

You can look this up in your favorite search engine.

Quebradawill

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

Process finished with exit code -1073741819 (0xC0000005)

I don't think this has to do with this repo. Have you reached a memory limit?

Quebradawill

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

Unet model error

https://github.com/milesial/Pytorch-UNet/blob/84f8392b619940bd542dc670761a0a7a1357001d/unet/unet_model.py#L20

https://github.com/milesial/Pytorch-UNet/blob/84f8392b619940bd542dc670761a0a7a1357001d/unet/unet_parts.py#L16

xc769458796

comment created time in 2 months

issue closedmilesial/Pytorch-UNet

I have some questions

I had this problem running predictions usage: predict.py [-h] [--model FILE] --input INPUT [INPUT ...] [--output INPUT [INPUT ...]] [--viz] [--no-save] [--mask-threshold MASK_THRESHOLD] [--scale SCALE] predict.py: error: the following arguments are required: --input/-i An exception has occurred, use %tb to see the full traceback.

SystemExit: 2 I want to know why

closed time in 2 months

Lee-h96

issue closedmilesial/Pytorch-UNet

About the multi-class problem

Thanks for your code. I implemented this code to solve a simple multi-class segmentation problem, and encounter several problems.

  1. For image / mask pair, I prepare a RGB-image (3 * H * W) set and a corresponding mask set (1 * H * W).
  2. As I have 4 classes, the label of each mask pixel is selected from [1, 2, 3, 4].
  3. I set n_channels=3 and n_classes=3.

When I start to train:

  1. SpatialClassNLLCriterion.cu:104: void cunn_SpatialClassNLLCriterion_updateOutput_kernel(T *, T *, T *, long *, T *, int, int, int, int, int, long) [with T = float, AccumT = float]: block: [0,0,0], thread: [544,0,0] Assertion t >= 0 && t < n_classes failed. ----- It seems that the numeric value of mask should not be greater than 1, thus integer labels within [1, 2, 3, 4] are not feasible. As the consequence, I have the mask divide img_trans.max() as the image do, thus the label is [0.25, 0.5, 0.75, 1]. This action makes the training procedure fine (Validation cross entropy: 1.005), but the 100-epoch module predicts a all [0.25] mask image.

I read the related issue (https://github.com/milesial/Pytorch-UNet/issues/15), but get no useful info. (It seems that all related issues are solved by the most recent commit).

Looking forward for your reply, thanks again.

closed time in 2 months

Inosonnia

issue commentmilesial/Pytorch-UNet

About the multi-class problem

Go to https://github.com/milesial/Pytorch-UNet/issues/15 for multi class discussion

Inosonnia

comment created time in 2 months

issue closedmilesial/Pytorch-UNet

RuntimeError: 1only batches of spatial targets supported (non-empty 3D tensors) but got targets of size: : [1, 1, 360, 640]

I have three classes. The training mask is assigned in 0,1,2 gray scale. The training times are wrong. After reading the description of previous related problems, my problem should be that there is a problem in the training load mask. If there is more classification, do I need to modify your code?How to modify?

closed time in 2 months

dbAIStudio

issue closedmilesial/Pytorch-UNet

Use of ConvTransPose2d()

https://github.com/milesial/Pytorch-UNet/blob/d685fe10ac571e28e818a9d8fb19013e3346ee5f/unet/unet_parts.py#L50

I don't quite get it, why should we use in_channels//2 but not in_channels.

closed time in 2 months

Kxy-Moriaty

issue closedmilesial/Pytorch-UNet

RuntimeError: Expected object of scalar type Byte but got scalar type Double for sequence element 2 in sequence argument at position #1 'tensors'

Complete error message:

Traceback (most recent call last): File "D:/python workspace/Pytorch-UNet/train.py", line 175, in <module> val_percent=args.val / 100) File "D:/python workspace/Pytorch-UNet/train.py", line 67, in train_net for batch in train_loader: File "E:\anaconda\envs\python36\lib\site-packages\torch\utils\data\dataloader.py", line 582, in next return self._process_next_batch(batch) File "E:\anaconda\envs\python36\lib\site-packages\torch\utils\data\dataloader.py", line 608, in _process_next_batch raise batch.exc_type(batch.exc_msg) RuntimeError: Traceback (most recent call last): File "E:\anaconda\envs\python36\lib\site-packages\torch\utils\data_utils\worker.py", line 99, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "E:\anaconda\envs\python36\lib\site-packages\torch\utils\data_utils\collate.py", line 63, in default_collate return {key: default_collate([d[key] for d in batch]) for key in batch[0]} File "E:\anaconda\envs\python36\lib\site-packages\torch\utils\data_utils\collate.py", line 63, in <dictcomp> return {key: default_collate([d[key] for d in batch]) for key in batch[0]} File "E:\anaconda\envs\python36\lib\site-packages\torch\utils\data_utils\collate.py", line 43, in default_collate return torch.stack(batch, 0, out=out) RuntimeError: Expected object of scalar type Byte but got scalar type Double for sequence element 2 in sequence argument at position #1 'tensors'

An error line:

for epoch in range(epochs):
    net.train()
    epoch_loss = 0
    with tqdm(total=n_train, desc=f'Epoch {epoch + 1}/{epochs}', unit='img') as pbar:
        for batch in train_loader: ##############An error line
            imgs = batch['image']
            true_masks = batch['mask']
            assert imgs.shape[1] == net.n_channels, \
                f'Network has been defined with {net.n_channels} input channels, ' \
                f'but loaded images have {imgs.shape[1]} channels. Please check that ' \
                'the images are loaded correctly.'

            imgs = imgs.to(device=device, dtype=torch.float32)
            mask_type = torch.float32 if net.n_classes == 1 else torch.long
            true_masks = true_masks.to(device=device, dtype=mask_type)

I want to increase the value of batchsize. When I increase the batchsize from the default value of 1 to 8 or 16, I will report this kind of mismatching error. How to solve this problem and what is the reason?Thank you very much

closed time in 2 months

zxzyzlz

issue closedmilesial/Pytorch-UNet

About n_classes question.

line 154-155 of code 'train.py' both indicate that n_classes = 1.
if I get background and one class why not 'n_classes=2', and 'n_classes =3' when I have 2 classes

closed time in 2 months

ROOKLO

issue closedmilesial/Pytorch-UNet

about dice loss

I'm confused if we can use dice loss in training, and what should i do ?

closed time in 2 months

kobe233333

issue closedmilesial/Pytorch-UNet

Question about submit.py and predict.py results

I use the same epoch10.pth to test, however the predict.py results better than submit results,Can you tell me the reason,thanks! 图片 ( submit result)

图片 (predict result)

图片 (mask)

closed time in 2 months

WangHeHehehehe

issue closedmilesial/Pytorch-UNet

libtorch How to covert torch::Tensor to cv::Mat ?

Excuse me, how to convert it to CV:: mat

Some of the converted pictures are not normal

closed time in 2 months

luocheng610

issue closedmilesial/Pytorch-UNet

Just some minor issues,

First off, when I am training -on my 100 image dataset- I get a constant dice coef. does this mean anything or does it just mean that I am missing something? Also when I try to predict, it says it needs a --model param is there any model I could be using for biomedical binary segmentation? Thanks!

closed time in 2 months

Khalifa1997

issue closedmilesial/Pytorch-UNet

About TypeError: narrow(): argument 'length' (position 3) must be int, not Tensor

Hi ,when I run train.py, I met such an error, if anyone also met?

Epoch 1/10: 0%| | 0/3300 [00:00<?, ?img/s]/home/CN/zizhang.wu/anaconda3/lib/python3.6/site-packages/torch/nn/modules/upsampling.py:122: UserWarning: nn.Upsampling is deprecated. Use nn.functional.interpolate instead. warnings.warn("nn.Upsampling is deprecated. Use nn.functional.interpolate instead.")

Traceback (most recent call last): File "train.py", line 172, in <module> val_percent=args.val / 100) File "train.py", line 77, in train_net masks_pred = net(imgs) File "/home/CN/wu/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/mnt/nfs/04_centerNet/CenterNet-master_dlz_segmentation/Pytorch-UNet-master/unet/unet_model.py", line 32, in forward x = self.up1(x5, x4) File "/home/CN/wu/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/mnt/nfs/04_centerNet/CenterNet-master_dlz_segmentation/Pytorch-UNet-master/unet/unet_parts.py", line 61, in forward diffY // 2, diffY - diffY // 2]) File "/home/CN/wu/anaconda3/lib/python3.6/site-packages/torch/nn/functional.py", line 2159, in pad return ConstantPadNd.apply(input, pad, value) File "/home/CN/wu/anaconda3/lib/python3.6/site-packages/torch/nn/_functions/padding.py", line 42, in forward c_output = c_output.narrow(i, 0, c_output.size(i) - p[1]) TypeError: narrow(): argument 'length' (position 3) must be int, not Tensor

closed time in 2 months

lizhuding

issue commentmilesial/Pytorch-UNet

About TypeError: narrow(): argument 'length' (position 3) must be int, not Tensor

Fixed by https://github.com/milesial/Pytorch-UNet/pull/167

lizhuding

comment created time in 2 months

issue closedmilesial/Pytorch-UNet

why your deepest layer only have 512?

you define 'self.down4 = Down(512, 512)', but from the u-net picture, we can see test deepest layer have 1024 maps.

closed time in 2 months

W-void

issue closedmilesial/Pytorch-UNet

Ho to use multiple gpus to train my model?

Hello, I want to train my model with 4 gpus via net = torch.nn.DataParallel(net) But there is a error raised.

AttributeError: 'DataParallel' object has no attribute 'n_classes'

I would like to consult you how to solve this problem.

Thank

closed time in 2 months

HongguLiu

issue commentmilesial/Pytorch-UNet

Ho to use multiple gpus to train my model?

Seems you have resolved your issue. Closing this.

HongguLiu

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

Dice coefficient no change during training,is always very close to 0

To help me debug the DICE issue, could you please give me a sample of what your self.inter and self.union values look like in https://github.com/milesial/Pytorch-UNet/blob/84f8392b619940bd542dc670761a0a7a1357001d/dice_loss.py#L11-L12 ? Also, how many images are in your validation set?

dantehy

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

Dice coefficient no change during training,is always very close to 0

@Quebradawill

how many images does the training set need?

It depends on the difficulty of your task and the data augmentation you're willing to do. For Carvana the training set was more than 4000 images.

dantehy

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

AssertionError: Either no mask or multiple masks found for the ID

  • About the filename error, I'm glad you were able to figure it out. It is just about the glob in dataset.py and has nothing to do with the number of channels, as the files are not even read at this stage (if you have an image 025.png, you have to have a mask 025.png (or whatever extension) in the mask folder). https://github.com/milesial/Pytorch-UNet/blob/84f8392b619940bd542dc670761a0a7a1357001d/utils/dataset.py#L46

  • Make sure your masks are loaded as greyscale and 1 channel if you wish to train with 1 output channel. https://github.com/milesial/Pytorch-UNet/issues/149 https://github.com/milesial/Pytorch-UNet/issues/164 https://github.com/milesial/Pytorch-UNet/issues/113

qiuyuan666

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

AssertionError: Either no mask or multiple masks found for the ID

Hi, a few questions:

  • Are you on the latest version? This should have been fixed in https://github.com/milesial/Pytorch-UNet/pull/187
  • Can you put here the full error, including the ID and the mask names
  • You said you renamed your images, did you also rename your masks to match?
qiuyuan666

comment created time in 2 months

push eventmilesial/Pytorch-UNet

milesial

commit sha 84f8392b619940bd542dc670761a0a7a1357001d

Update README with xs:code

view details

push time in 2 months

issue commentmilesial/Pytorch-UNet

It can be trained but not predictable

The threshold, mainly, to see if the output probs make sense

goodsave

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

It can be trained but not predictable

Have you tried predicting without any threshold and saving the greyscale mask?

goodsave

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

Hi,I have a question

When the classes are binary and we have only one output layer, we apply sigmoid to extract probabilities from raw logits.

YueZhangX

comment created time in 2 months

issue closedmilesial/Pytorch-UNet

dataset

Where to download training data?

closed time in 2 months

j2538318409

issue commentmilesial/Pytorch-UNet

dataset

Please read the README.

The Carvana data is available on the Kaggle website.

j2538318409

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

TypeError: to() received an invalid combination of arguments

Hi, I updated the master branch, can you try again? Thanks

wjj001-dl

comment created time in 2 months

push eventmilesial/Pytorch-UNet

milesial

commit sha 2eb8a6ff539ac0f4838ce1161b6d239e912ca007

Fix device in submit.py

view details

push time in 2 months

issue commentmilesial/Pytorch-UNet

Dice coefficient no change during training,is always very close to 0

With 50 training data and no data augmentation I don't think you can expect good generalization results. The line you added seems fine if you have binary labels, you need to check that you have only 0s and 1s in your mask. If you have more than 2 classes, the mask should contain class indices.

dantehy

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

Dice coefficient no change during training,is always very close to 0

B&W means black & white. With PIL you can convert to greyscale https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.convert .

dantehy

comment created time in 2 months

issue commentmilesial/Pytorch-UNet

some question about the ‘train.py’

You should not change anything.

The loss is either CrossEntropyLoss or BCEWithLogitsLoss, in both cases logits are required and the criterion applies the normalization. For the tensorboard visualization, "sigmoid then threshold" is used because that's what is used for prediction with binary masks.

Herbie007

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

pretrained model

I will train a Carvana model at 10 reactions on the original comment.

QIQIVTrackingY

comment created time in 3 months

issue closedmilesial/Pytorch-UNet

.PTH file missing

Could you please provide the .PTH file as well. Its a bit difficult to train the model for me as i don't have the required resources.

closed time in 3 months

aayushk614

issue commentmilesial/Pytorch-UNet

pretrained model

Warning, the repo at that version was quite buggy, and this model is not compatible with the current version.

QIQIVTrackingY

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

Just some minor issues,

If you already have a pretrained model that was trained on similar images, fine-tuning on your dataset should be fine. You would have to load the weights before running the training loop.

Khalifa1997

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

pretrained model

@VictorZoo Not yet, do you want one for the Carvana dataset?

QIQIVTrackingY

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

about negative issue

That's really strange, I'll leave this open for others to investigate. The code is there so the images should be transformed.

ImMial

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

Just some minor issues,

The constant DICE may mean that something is wrong with how you load your dataset or how the evaluation split is done.

You need to train your own model specific to your task. I'd advise getting more data, 100 images is not really enough in my opinion.

Khalifa1997

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

about negative issue

@RaindyLihuahua The BCE loss can't be negative so it just means you are loading your masks wrong. Check that your true masks match the specs.

ImMial

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

Why choose not to add dropout layers?

The network is not dense and is fully convolutionnal so I don't think dropout layers would be effective. But it can be used for implicit data augmentation according to the authors:

Drop-out layers at the end of the contracting path perform further implicit data augmentation

(section 3.1)

flgau

comment created time in 3 months

issue closedmilesial/Pytorch-UNet

i want to use grayscale image and mask image.. i want big help from you ㅠㅡㅠ

Screenshot from 2020-06-30 10-32-30

i want to use image like grayscale input and mask input.. but there is dimention error how can i use grayscale image?

closed time in 3 months

skyoung2811

issue commentmilesial/Pytorch-UNet

i want to use grayscale image and mask image.. i want big help from you ㅠㅡㅠ

By training the model with train.py. Please read the full README before opening issues.

skyoung2811

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

i want to use grayscale image and mask image.. i want big help from you ㅠㅡㅠ

If you want to predict with predict.py, read the README, it's explained there.

skyoung2811

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

i want to use grayscale image and mask image.. i want big help from you ㅠㅡㅠ

PNG or any format is fine as long as you transform the loaded masks and images to have to needed dimensionality. Look at the Pillow documentation to make sure you loaded your masks correctly.

skyoung2811

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

i want to use grayscale image and mask image.. i want big help from you ㅠㅡㅠ

Change your input channels to 1! For the loss, the target is the true masks and the input is the predicted masks. Here your target size is wrong, meaning you're loading your masks wrong.

skyoung2811

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

i want to use grayscale image and mask image.. i want big help from you ㅠㅡㅠ

Make sure you are using greyscale images and loading them as such in https://github.com/milesial/Pytorch-UNet/blob/1c6a9505c964fdd1bc7d55887725551afc94b956/utils/dataset.py#L54

skyoung2811

comment created time in 3 months

issue commentmilesial/Pytorch-UNet

i want to use grayscale image and mask image.. i want big help from you ㅠㅡㅠ

If you have only one input channel, then you have to change to parameters of the construction of the Unet. https://github.com/milesial/Pytorch-UNet/blob/1c6a9505c964fdd1bc7d55887725551afc94b956/train.py#L157 change n_channels to 1

skyoung2811

comment created time in 3 months

more