DeepCGH icon indicating copy to clipboard operation
DeepCGH copied to clipboard

Different numbers of depth does not work with training

Open sumiya-kuroda opened this issue 1 year ago • 2 comments

Hello,

when I dcgh.train with different numbers of depth planes, such as 'shape' : (1024, 1024, 6), I get this error message:

ValueError: Dimensions must be equal, but are 5 and 6 for '{{node mul_5}} = Mul[T=DT_FLOAT](concat, IteratorGetNext:1)' with input shapes: [?,1024,1024,5], [?,1024,1024,6].

Do you know what went wrong and how one can fix this issue?

Thanks!

sumiya-kuroda avatar May 28 '24 18:05 sumiya-kuroda

Hi @sumiya-kuroda ,

I will take a look and get back to you asap. Would you be able to share your module parameters here with me? Specifically data and model dictionaries.

hosseybposh avatar May 28 '24 18:05 hosseybposh

Thanks @hosseybposh ! Here are the data parameters. I did not change the model parameters. I have been trying to run this on TensorFlow 2.13 if this is also relevant.

data = {'path' : 'DeepCGH_Datasets/Disks',# path to store the data
        'shape' : (1024, 1024, 6),# shape of the holograms. The last dimension determines the number of depth planes
        'object_type' : 'Disk',# shape of the object in simulated images, can be disk, square, or line
        'object_size' : 10,# has no effect if object type is 'Line'
        'object_count' : [27, 48],# number of random objects to be created
        'intensity' : 1,# the (range of) intensity of each object. If a range is specified, for each object the intensity is randomly determined
        'normalize' : True,# if the data is 3D, it'll normalize the intensities from plane to plane (see manuscript fot more info)
        'centralized' : False,# avoids putting objects near the edges of the hologram (useful for practical optogenetics applications)
        'N' : 50, # number of sample holograms to generate
        'train_ratio' : 400/5000,# the ratio of N that will be used for training
        'compression' : 'GZIP',# tfrecords compression format
        'name' : 'target',# name of the dictionary that contains the targets (leave as "target" if you're not changing the structure of network input)

sumiya-kuroda avatar May 28 '24 19:05 sumiya-kuroda