Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named dataset_loaders.images.camvid #1

Open
kuixu opened this issue Dec 5, 2016 · 14 comments
Open

ImportError: No module named dataset_loaders.images.camvid #1

kuixu opened this issue Dec 5, 2016 · 14 comments

Comments

@kuixu
Copy link

kuixu commented Dec 5, 2016

Looking forward to the dataset_loaders.

Traceback (most recent call last):
  File "train.py", line 16, in <module>
    from data_loader import load_data
  File "/data/kuixu/exper/fcn/FC-DenseNet/data_loader.py", line 1, in <module>
    from dataset_loaders.images.camvid import CamvidDataset
ImportError: No module named dataset_loaders.images.camvid
@SimJeg
Copy link
Owner

SimJeg commented Dec 5, 2016 via email

@kuixu
Copy link
Author

kuixu commented Dec 8, 2016

@SimJeg Thanks for your detailed description of the dataset loader so that I can repeat it.

@amiltonwong
Copy link

Hi, @barrykui ,

Did you work out the dataset_loaders? If yes, could you release it on-line?

THX~

@rozefeld
Copy link

Hello.

I am trying to apply your network on my data.
It is stated in README.md that "X is the batch of input images (shape= (batch_size, n_classes, n_rows, n_cols), dtype=float32) "
My quwstion is: shouldn't it be shape= (batch_size, 3, n_rows, n_cols), dtype=float32, a.k.a. THREE color channels?

Thank you

@SimJeg
Copy link
Owner

SimJeg commented Jan 14, 2017 via email

@qiaotian
Copy link

qiaotian commented Feb 4, 2017

Hello,

I'm also trying to use this network, but I got some errors after I implemented my own Iterator. The last several lines are listed as follows:

TypeError: Cannot convert Type TensorType(float64, 4D) (of Variable AbstractConv2d_gradInputs{border_mode='half', subsample=(1, 1), filter_flip=False, imshp=(None, 3, None, None), kshp=(48, 3, 3, 3)}.0) into Type TensorType(float32, 4D). You can try to manually convert AbstractConv2d_gradInputs{border_mode='half', subsample=(1, 1), filter_flip=False, imshp=(None, 3, None, None), kshp=(48, 3, 3, 3)}.0 into a TensorType(float32, 4D).

Does anyone meet this before?
Any clue will be greatly appreciated.

@SimJeg
Copy link
Owner

SimJeg commented Feb 4, 2017 via email

@qiaotian
Copy link

qiaotian commented Feb 5, 2017

Thanks a lot !!!
It seems to work when I add 'floatX=float32' to THEANO_FLAGS.

@qiaotian
Copy link

qiaotian commented Feb 6, 2017

Hi, @SimJeg . I encounter another problem, which I tried my best but failed to solve.

I test my own dataset on this network.
But, it always returns the CNMEM_STATUS_OUT_OF_MEMORY message when excuting loss, I, U, acc = f(X, Y[:, None, :, :]) inside batch_loop function.
It is not clear to me whether this error is caused by the illegal iterator, the large intermediate values or theano limitations. Looking forward to your reply.

PS. My GPU is one piece of Titan X Maxwell (12GB mem).

The .theanorc and error message are provided as follows:

  1. '.theanorc' file content:

[global]
floatX = float32
device = gpu2
optimizer = fast_compile
optimizer_including = fusion
allow_gc = True
print_active_device = True
optimizer_including = cudnn
[lib]
cnmem = 0.8
[dnn]
enabled = True

  1. Error message:

.....
Number of Convolutional layers : 103
Number of parameters : 9426191
Compilation starts at 2017-02-06 11:49:04
train compilation took 620.547 seconds
valid compilation took 152.227 seconds
Training starts at 2017-02-06 12:02:04
Traceback (most recent call last):
File "train.py", line 307, in
initiate_training(cf)
File "train.py", line 276, in initiate_training
train(cf)
File "train.py", line 198, in train
history = batch_loop(train_iter, train_fn, epoch, 'train', history)
File "train.py", line 89, in batch_loop
loss, I, U, acc = f(X, Y[:, None, :, :])
File "/home/qiao/anaconda2/envs/tensorflow/lib/python2.7/site-packages/theano/compile/function_module.py", line 871, in call
storage_map=getattr(self.fn, 'storage_map', None))
File "/home/qiao/anaconda2/envs/tensorflow/lib/python2.7/site-packages/theano/gof/link.py", line 314, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/home/qiao/anaconda2/envs/tensorflow/lib/python2.7/site-packages/theano/compile/function_module.py", line 859, in call
outputs = self.fn()
MemoryError: Error allocating 503316480 bytes of device memory (CNMEM_STATUS_OUT_OF_MEMORY).
Apply node that caused the error: GpuElemwise{mul,no_inplace}(CudaNdarrayConstant{[[[[ 0.5]]]]}, GpuElemwise{add,no_inplace}.0)
Toposort index: 5298
Inputs types: [CudaNdarrayType(float32, (True, True, True, True)), CudaNdarrayType(float32, 4D)]
Inputs shapes: [(1, 1, 1, 1), (5, 96, 512, 512)]
Inputs strides: [(0, 0, 0, 0), (25165824, 262144, 512, 1)]
Inputs values: [CudaNdarray([[[[ 0.5]]]]), 'not shown']
Outputs clients: [[GpuContiguous(GpuElemwise{mul,no_inplace}.0)]]

HINT: Re-running with most Theano optimization disabled could give you a back-trace of when this node was created. This can be done with by setting the Theano flag 'optimizer=fast_compile'. If that does not work, Theano optimizations can be disabled with 'optimizer=None'.
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.

@SimJeg
Copy link
Owner

SimJeg commented Feb 6, 2017 via email

@qiaotian
Copy link

qiaotian commented Feb 8, 2017

Thanks for your suggestion. But the error remains even if I changed the cnmem to 1. I looked up more docs and found out the following two that might make sense.

According to danlanchen and theano official doc, the error occurs mainly due to large number of generated intermediate values and fragmented gpu memory.

Fortunately, the error disappears after decreasing both the network depth and the number of filters.

@SimJeg
Copy link
Owner

SimJeg commented Feb 8, 2017 via email

@qiaotian
Copy link

qiaotian commented Feb 9, 2017

@SimJeg
The error indeed arises from the big size of input images. It works well if I crop the raw images in 'batch_loop' manually and then feed these cropped images to the network.
I should have paid attention to my own training image size (╯□╰).
Thanks again for your kind help.

@SimJeg
Copy link
Owner

SimJeg commented Feb 9, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants