Coder Social home page Coder Social logo

Comments (21)

LeeJunHyun avatar LeeJunHyun commented on June 22, 2024

Dear @PanPan0210 , I think your directory name is different from mine.

from image_segmentation.

YangBai1109 avatar YangBai1109 commented on June 22, 2024

yeah i think so ,could you tell me your directory name ? i didnot find it in the readme.md document

from image_segmentation.

LeeJunHyun avatar LeeJunHyun commented on June 22, 2024

In the 'dataset.py' ,

parser.add_argument('--origin_data_path', type=str, default='../ISIC/dataset/ISIC2018_Task1-2_Training_Input')
parser.add_argument('--origin_GT_path', type=str, default='../ISIC/dataset/ISIC2018_Task1_Training_GroundTruth')
    
parser.add_argument('--train_path', type=str, default='./dataset/train/')
parser.add_argument('--train_GT_path', type=str, default='./dataset/train_GT/')
parser.add_argument('--valid_path', type=str, default='./dataset/valid/')
parser.add_argument('--valid_GT_path', type=str, default='./dataset/valid_GT/')
parser.add_argument('--test_path', type=str, default='./dataset/test/')
parser.add_argument('--test_GT_path', type=str, default='./dataset/test_GT/')

'../ISIC/dataset/ISIC2018_Task1-2_Training_Input' is the origin image path,
'../ISIC/dataset/ISIC2018_Task1_Training_GroundTruth' is the origin ground truth path
'./dataset/train/' is the path for split dataset.
'./dataset/train_GT/' is the path for ground truth of split dataset.

from image_segmentation.

YangBai1109 avatar YangBai1109 commented on June 22, 2024

hello ,thank you dor your answer ,but i have another problem

RuntimeError: Given groups=1, weight of size [64, 3, 3, 3], expected input[1, 1, 256, 256] to have 3 channels, but got 1 channels instead

how can i solve it ?
i'am so sorry because this is my first study ,so i have a lot questions .

from image_segmentation.

LeeJunHyun avatar LeeJunHyun commented on June 22, 2024

It's ok, I think you read the wrong data as a input. (may be ground truth image)

ISIC input image file have RGB 3 channels, but your file has only 1 channel like the gray scale image.

from image_segmentation.

YangBai1109 avatar YangBai1109 commented on June 22, 2024

yeah,i just use a gray scale image ,so what should i do to use it?

from image_segmentation.

LeeJunHyun avatar LeeJunHyun commented on June 22, 2024

You should use RGB 3 channels images as the input.
You can get the ISIC 2018 RGB images at here or https://challenge2018.isic-archive.com/task1/training/.
I had used this dataset, so you can use my code with these.

from image_segmentation.

YangBai1109 avatar YangBai1109 commented on June 22, 2024

so ,i can't use my dataset in this code ?

from image_segmentation.

LeeJunHyun avatar LeeJunHyun commented on June 22, 2024

Do you have only 1 channel image?

Then, you should change setting to img_ch=1 at the solver.py#L55.

from image_segmentation.

YangBai1109 avatar YangBai1109 commented on June 22, 2024

thank you very much for your help
but how can i save the segmentation result image ?
that is prediction result

from image_segmentation.

LeeJunHyun avatar LeeJunHyun commented on June 22, 2024

solver.py#L231 Here is the code for saving images. You can modify this code to save whole images.

from image_segmentation.

YangBai1109 avatar YangBai1109 commented on June 22, 2024

thank you very much ;
how can i plot the accuracy and loss curve???

from image_segmentation.

LeeJunHyun avatar LeeJunHyun commented on June 22, 2024

I didn't implement the code for plotting a graph, but you can refer here :)

from image_segmentation.

YangBai1109 avatar YangBai1109 commented on June 22, 2024

thank you for your help ,
could you tell me how to solve this problem?
Traceback (most recent call last): File "/home/panpan/wenjian/pytorchImage_Segmentation-master/main.py", line 105, in <module> main(config) File "/home/panpan/wenjian/pytorchImage_Segmentation-master/main.py", line 61, in main solver.train() File "/home/panpan/wenjian/pytorchImage_Segmentation-master/solver.py", line 139, in train for i, (images, GT) in enumerate(self.train_loader): File "/home/panpan/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 637, in __next__ return self._process_next_batch(batch) File "/home/panpan/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 658, in _process_next_batch raise batch.exc_type(batch.exc_msg) TypeError: Traceback (most recent call last): File "/home/panpan/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/panpan/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in <listcomp> samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/panpan/wenjian/pytorchImage_Segmentation-master/data_loader.py", line 58, in __getitem__ image = Transform(image) File "/home/panpan/anaconda3/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 49, in __call__ img = t(img) File "/home/panpan/anaconda3/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 822, in __call__ return F.rotate(img, angle, self.resample, self.expand, self.center) File "/home/panpan/anaconda3/lib/python3.6/site-packages/torchvision/transforms/functional.py", line 595, in rotate return img.rotate(angle, resample, expand, center) TypeError: rotate() takes from 2 to 4 positional arguments but 5 were given

i do not know how to solve it

from image_segmentation.

LeeJunHyun avatar LeeJunHyun commented on June 22, 2024

I think your pytorch version is not fit with your code.
Or you can change the code for image rotation.

from image_segmentation.

YangBai1109 avatar YangBai1109 commented on June 22, 2024

hello,i want to know

Epoch [3/150], Loss: 1130.9463,
[Training] Acc: 0.7911, SE: 0.9983, SP: 0.7911, PC: 0.0002, F1: 0.0004, JS: 0.0002, DC: 0.0004
[Validation] Acc: 0.7926, SE: 1.0000, SP: 0.7926, PC: 0.0002, F1: 0.0004, JS: 0.0002, DC: 0.0004

why the value of 'Loss'is so big ?i do not know if it is a error ?

from image_segmentation.

LeeJunHyun avatar LeeJunHyun commented on June 22, 2024

Is it for your own data? or ISIC data?

from image_segmentation.

YangBai1109 avatar YangBai1109 commented on June 22, 2024

on my own data ,the loss is very high ,and the result is bad ,

from image_segmentation.

LeeJunHyun avatar LeeJunHyun commented on June 22, 2024

then I cannot help you. because I have not any information about your data.
You should check the your data. Sorry :(

from image_segmentation.

YangBai1109 avatar YangBai1109 commented on June 22, 2024

thank you ,

from image_segmentation.

LeeJunHyun avatar LeeJunHyun commented on June 22, 2024

If you have no further questions, I will close the issue. I hope my answer was helpful.

from image_segmentation.

Related Issues (20)

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.