Giter Club home page Giter Club logo

relaynet_pytorch's Introduction

relaynet_pytorch

PyTorch Implementation of ReLayNet. There are still some bugs and issues in the code, we are working on fixing them.

Coded by Abhijit Guha Roy and Shayan Siddiqui (https://github.com/shayansiddiqui)

If you use this code for any academic purpose, please cite:

A. Guha Roy, S. Conjeti, S.P.K.Karri, D.Sheet, A.Katouzian, C.Wachinger, and N.Navab, "ReLayNet: retinal layer and fluid segmentation of macular optical coherence tomography using fully convolutional networks," Biomed. Opt. Express 8, 3627-3642 (2017) Link: https://arxiv.org/abs/1704.02161

Enjoy!! :)

relaynet_pytorch's People

Contributors

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

relaynet_pytorch's Issues

torch.load import error

I tried to follow the example code that was given, it gives the following error in Ubuntu 18.04, any help would be appreciated.
`ModuleNotFoundError Traceback (most recent call last)
in ()
4 from torch.autograd import Variable
5
----> 6 relaynet_model = torch.load('models/relaynet_good.model')

~/.local/lib/python3.6/site-packages/torch/serialization.py in load(f, map_location, pickle_module)
301 f = open(f, 'rb')
302 try:
--> 303 return _load(f, map_location, pickle_module)
304 finally:
305 if new_fd:

~/.local/lib/python3.6/site-packages/torch/serialization.py in _load(f, map_location, pickle_module)
467 unpickler = pickle_module.Unpickler(f)
468 unpickler.persistent_load = persistent_load
--> 469 result = unpickler.load()
470
471 deserialized_storage_keys = pickle_module.load(f)

ModuleNotFoundError: No module named 'networks.classifiers'
`

All Layer Classification

I've got the model working however it seems to only classify the top layer in an image (in black and white whereas paper had all layers being segmented in colour). Is this something that is being worked on? If not where can I contribute to bring this up to speed

ReLU or Prelu

In your paper and the original matlab code, you used Relu. However in this code you used Prelu

No sample dataset to test input format

I get the following error code when trying to run the first few lines of code offline on my machine, since there is no test data set to run he model on there. We have some SD-OCT images which we could use there if we new the correct specifications to input to the model. We plan to cite your work and employ it in a further research paper:

File "/home/seanogor/Documents/Nandan/retinalwork/relaynet_pytorch/networks/data_utils.py", line 35, in get_imdb_data
Data = h5py.File('datasets/Data.h5', 'r')
File "/usr/local/lib/python3.5/dist-packages/h5py/_hl/files.py", line 312, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/usr/local/lib/python3.5/dist-packages/h5py/_hl/files.py", line 142, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 78, in h5py.h5f.open
OSError: Unable to open file (unable to open file: name = 'datasets/Data.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

data.h5

How should I download data.h5 file?

need help

If you can give me the code which can transfer raw data "Subject_*.mat" to datasets/Data.h5 ,It would be a great help . --a student who is very interested in the field of OCT segmentation.

unable to reproduce paper result

Hi, thank you very much for sharing the code. I read your paper, it is a great paper. However, using this repo doesn't seem to be able to reproduce the good result in the paper. I also noticed that several details were not implemented, for example, the weigheted loss at the boundary.
I tried implemented myself, but get no luck. Even I used the UNet architecture (CM-UNet), I still can't reproduce the dice score in your paper. I got lower score on INL, OPL, and RPE.
Could you share more on the implementation details?

The implementation of DiceLoss

Thanks for your share. When I run this version (40ae1aa) code and I get the following error:
`/userfolder/relaynet_pytorch/relaynet_pytorch/net_api/losses.py in forward(self, output, target, weights, ignore_index)
60 encoded_target[mask] = 0
61 else:
---> 62 encoded_target.scatter_(1, target.unsqueeze(1), 1)
63
64 if weights is None:

RuntimeError: invalid argument 3: Index tensor must have same dimensions as output tensor at /pytorch/aten/src/THC/generic/THCTensorScatterGather.cu:289
`

And the input data's size is [NumData, 1, rows, cols], the corresponding label's size is [NumData, 1,rows, cols]. The target of our is to segment 10 class.
I read the code and don't understand these code:

`
relaynet_pytorch/relaynet_pytorch/net_api/losses.py

lin51:output = output.exp()

lin52:encoded_target = output.detach() * 0

line61:encoded_target.scatter_(1, target.unsqueeze(1), 1)

`

In the older versions, the implementation of DiceLoss is different from this version code. And the older vision as follows:

`
class DiceLoss(_Loss):

def forward(self, input, target):

    return 1 - dice_coeff(input, target)

`

So which is better ? or which is the right version for the "ReLayNet" paper ?
Thanks a lot!

Something wrong about the datasets

Hello, I followed your instruction but confused about the datasets, I downloaded the datasets from the link (http://people.duke.edu/~sf59/Chiu_BOE_2014_dataset.htm) as mentioned in the paper, while the datasets consist of 610 annotated SD-OCT B-scan images of size 496x768 obtained from 10 patients suffering from DME (61 B-scans per patient). This is very different from the paper description, I think I had downloaded the wrong datasets, can you show the right link of the datasets download? thank you a lot!

When trying to run the solver.train() function, the following error is returned. Any idea why this is?

RuntimeError: Traceback (most recent call last):
File "/home/sim/anaconda3/envs/py3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 57, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/sim/anaconda3/envs/py3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 57, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/sim/notebooks/relaynet_pytorch/relaynet_pytorch/data_utils.py", line 23, in getitem
weight = torch.from_numpy(weight)
RuntimeError: Trying to resize storage that is not resizable at /home/sim/install/pytorch/aten/src/TH/generic/THStorage.c:183

ModuleNotFoundError: No module named 'networks.relay_net'

I'm getting the following error when trying to load a pretrained model.

model = torch.load('path/to/model/relaynet_epoch20.model')

Traceback (most recent call last):
File "C:\Users\gelaz\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2862, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
relaynet_model = torch.load(r'C:\Users\gelaz\PycharmProjects\VariationalOptimization\relaynet_pytorch\models\Exp01/relaynet_epoch20.model')
File "C:\Users\gelaz\Anaconda3\lib\site-packages\torch\serialization.py", line 367, in load
return _load(f, map_location, pickle_module)
File "C:\Users\gelaz\Anaconda3\lib\site-packages\torch\serialization.py", line 538, in _load
result = unpickler.load()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.1.1\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'networks.relay_net'

Problems with loading pretrained models

When I try to run the test code I got
ModuleNotFoundError: No module named 'networks.relay_net'
It seems the "relaynet_pytorch" folder used to be called "networks" in your pretrained model.
Could you change the folder names back to "networks" to avoid such confusions? Thank you!

about dataset

Great job! But I have a problem about the 2015_BOE_Chiu dataset, when I load the Subject_0x.mat file into matlab R2017a, all the variables are NaN. Do any one has idea about that?

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.