Giter VIP home page Giter VIP logo

brainchild's People

Contributors

mauliknshah avatar raj-sivakumar avatar raj-sivakumar-zz avatar

Watchers

 avatar  avatar  avatar

Forkers

mauliknshah

brainchild's Issues

Resolve problems of loading PPMI data set in the Data Loader

Description of the Error:
=================================== FAILURES ===================================
______________________________ test_ppmi_dataset _______________________________

capsys = <_pytest.capture.CaptureFixture object at 0x7f5d5ac45588>

def test_ppmi_dataset(capsys):
data_dir = './data/PPMI_reg'
ds = brainchild.loader.PPMIData(data_dir)
with capsys.disabled():

      print(ds[0])

tests/loader_test.py:19:

brainchild/loader.py:42: in getitem
img = nibabel.load(meta['path'])
../../anaconda3/lib/python3.6/site-packages/nibabel/loadsave.py:43: in load
is_valid, sniff = image_klass.path_maybe_image(filename, sniff)
../../anaconda3/lib/python3.6/site-packages/nibabel/filebasedimages.py:499: in path_maybe_image
klass._compressed_suffixes)
../../anaconda3/lib/python3.6/site-packages/nibabel/filename_parser.py:266: in splitext_addext
if endswith(filename, ext):

whole = PosixPath('data/PPMI_reg/3004/sag_3D_FSPGR_BRAVO_straight/2011-04-05_14_45_45.0/S113507/PPMI_3004_MR_sag_3D_FSPGR_BRAVO_straight__br_raw_20110705113608182_33_S113507_I243167.nii')
end = '.gz'

def _iendswith(whole, end):

  return whole.lower().endswith(end.lower())

E AttributeError: 'PosixPath' object has no attribute 'lower'

../../anaconda3/lib/python3.6/site-packages/nibabel/filename_parser.py:224: AttributeError
====================== 1 failed, 2 passed in 4.32 seconds ======================

model() gives error in the vnet training

Parameters Initialized.
Process Started with Seed, 100
VNET Config.

  • Number of params: 65191134
    loading training set
    loading test set
    Setting Class Weights
    Setting the Optimization Algorithm.
    1

ValueError Traceback (most recent call last)
in ()
1 if name == 'main':
----> 2 main()

in main()
168 #Set Optimization parameters.
169 adjust_opt(opt_algo, optimizer, epoch)
--> 170 train_nll(is_cuda, epoch, model, trainLoader, optimizer, trainF, class_weights)
171 err = test_nll(is_cuda, epoch, model, testLoader, optimizer, testF, class_weights)
172 is_best = False

in train_nll(is_cuda, epoch, model, trainLoader, optimizer, trainF, weights)
9 data, target = Variable(data), Variable(target)
10 optimizer.zero_grad()
---> 11 output = model(data)
12 target = target.view(target.numel())
13 loss = F.nll_loss(output, target, weight=weights)

~/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
355 result = self._slow_forward(*input, **kwargs)
356 else:
--> 357 result = self.forward(*input, **kwargs)
358 for hook in self._forward_hooks.values():
359 hook_result = hook(self, input, result)

~/anaconda3/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py in forward(self, *inputs, **kwargs)
66 def forward(self, *inputs, **kwargs):
67 if not self.device_ids:
---> 68 return self.module(*inputs, **kwargs)
69 inputs, kwargs = self.scatter(inputs, kwargs, self.device_ids)
70 if len(self.device_ids) == 1:

~/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
355 result = self._slow_forward(*input, **kwargs)
356 else:
--> 357 result = self.forward(*input, **kwargs)
358 for hook in self._forward_hooks.values():
359 hook_result = hook(self, input, result)

~/localgit/brainchild/brainchild/vnet.py in forward(self, x)
208
209 def forward(self, x):
--> 210 out16 = self.in_tr(x)
211 out32 = self.down_tr32(out16)
212 out64 = self.down_tr64(out32)

~/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
355 result = self._slow_forward(*input, **kwargs)
356 else:
--> 357 result = self.forward(*input, **kwargs)
358 for hook in self._forward_hooks.values():
359 hook_result = hook(self, input, result)

~/localgit/brainchild/brainchild/vnet.py in forward(self, x)
83 def forward(self, x):
84 # do we want a PRELU here as well?
---> 85 out = self.bn1(self.conv1(x))
86 # split input in to 16 channels
87 x16 = torch.cat((x, x, x, x, x, x, x, x,

~/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
355 result = self._slow_forward(*input, **kwargs)
356 else:
--> 357 result = self.forward(*input, **kwargs)
358 for hook in self._forward_hooks.values():
359 hook_result = hook(self, input, result)

~/anaconda3/lib/python3.6/site-packages/torch/nn/modules/conv.py in forward(self, input)
386 def forward(self, input):
387 return F.conv3d(input, self.weight, self.bias, self.stride,
--> 388 self.padding, self.dilation, self.groups)
389
390

~/anaconda3/lib/python3.6/site-packages/torch/nn/functional.py in conv3d(input, weight, bias, stride, padding, dilation, groups)
119
120 if input is not None and input.dim() != 5:
--> 121 raise ValueError("Expected 5D tensor as input, got {}D tensor instead.".format(input.dim()))
122
123 f = _ConvNd(_triple(stride), _triple(padding), _triple(dilation), False,

ValueError: Expected 5D tensor as input, got 4D tensor instead.

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.