THUHoloLab / Holo-encoder

High-speed computer-generated holography (CGH) using autoencoder-based deep neural network
45 stars 10 forks source link

Wirtinger Holography #1

Open shy-29 opened 2 years ago

shy-29 commented 2 years ago

If you don’t mind, I would like to ask how you obtained Wirtinger holograms. I have been studying this recently, but I don’t know the process of generating Wirtinger holograms.

MiZhou22 commented 2 years ago

Hello, have you ever come across the problem while training the model: the size of the array doesn't match?

shy-29 commented 2 years ago

您好,您在训练模型时有没有遇到过:数组大小不匹配的问题?

Sorry, I have no problem using their trained model, but I did not proceed due to computer memory problems during my own training. Maybe you can check the resolution of the picture or the resolution-related part of the code

MiZhou22 commented 2 years ago

Thanks, I already solved that problem, just like you said.

HunagYuJie commented 2 years ago

Hello, I try to run this program "HoloEncoder_training.m", but show this error messages,

Error using nnet.internal.cnn.dlnetwork/forward (line 254) Layer 'ResUConv1_2': Invalid input data. Out of memory on device. To view more detail about available memory on the GPU, use 'gpuDevice()'. If the problem persists, reset the GPU by calling 'gpuDevice(1)'.

I use matlab R2020b version and use GPU is GTX-980Ti. @THUHoloLab @shy-29 @nophy If you don’t mind, can you help me? please🙏

MiZhou22 commented 2 years ago

I once come across this problem in my laptop before 1.Use a GPU with larger memory 2. Decrease the minibatch size

HunagYuJie commented 2 years ago

I once come across this problem in my laptop before 1.Use a GPU with larger memory 2. Decrease the minibatch size

2.but i already use minibatch size = 1, it's most minimize, so i need to use more Memory with GPU ?

Can you show me your matlab version and GPU type

best regards.

MiZhou22 commented 2 years ago

I use matlab2021a and GTX 1080Ti 8G

HunagYuJie commented 2 years ago

I use matlab2021a and GTX 1080Ti 8G

I use this program "HoloEncoder_training.m" want to training,

but show the error : "Error using dlfeval (line 43) Layer 'I': Invalid input data. Error using 'predict' in Layer fresnelLayer. The function threw an error and could not be executed."

Have anyone same problem in this training part?

Now I used GPU RTX-3090 & Matlab 2021a version

MiZhou22 commented 2 years ago

maybe it is the same question I came across above. Have you changed the content of the modelGradients function?

MiZhou22 commented 2 years ago

If you haven't, you need to change the "Xc = padarray(Xc,[852 852]);" part to "Xc = padarray(Xc,[1748 1748]);", cause some matrixes' sizes don't match.

HunagYuJie commented 2 years ago

If you haven't, you need to change the "Xc = padarray(Xc,[852 852]);" part to "Xc = padarray(Xc,[1748 1748]);", cause some matrixes' sizes don't match.

I have already changed it, but it is still the same error, you just download and change this part, and run well?