naturomics / CapsLayer

CapsLayer: An advanced library for capsule theory
Apache License 2.0
362 stars 117 forks source link

CapsNet on RGB 256*256 data #5

Closed deep0learning closed 6 years ago

deep0learning commented 6 years ago

Can you tell us please how can we apply your network to classify RGB 256*256 data.

The structure of my datasets is:

Train: Class 1:
0001.jpg 0002.jpg 0003.jpg
Class 2:
0001.jpg 0002.jpg 0003.jpg
Thank you so much in advanced.

naturomics commented 6 years ago

@deep0learning What do you think the difference is between RGB image and gray image? All you need is just change the channels from 1 to 3 in this line.

movefast commented 6 years ago

You'll probably also want to change the channel num during recon as well for the same reason naturomics mentioned; otherwise, you'll likely run into some reshaping errors.

naturomics commented 6 years ago

@movefast It's replaced with variables now, no need to modify these lines

deep0learning commented 6 years ago

@naturomics Thank you so much. Actually I am new at programming. Can you please tell me how can we feed our data? I am not sure that how can we feed our data to this network?

naturomics commented 6 years ago

@deep0learning Write your own data loading function like this losd_mnist or this load_fashion_mnist, and add it to the function load_data and get_batch_data

Ahmedest61 commented 6 years ago

In some case, when using data equal or greater then 128x128 RGB, it may come across the problem of Cannot create a tensor proto whose content is larger than 2GB when you run tf.train.slice_input_producer([trX, trY]) as in this code or in some capsulenet, when self.sess.run(tf.global_variables_initializer()) runs, the system memory shoots up and code get crash all the time :(