Luochenghuang / metabox

A multi-scale differential optimization framework for diffractive optical systems.
MIT License
31 stars 7 forks source link

issue with model training #4

Open mnadeemakram opened 3 weeks ago

mnadeemakram commented 3 weeks ago

when i issue the training function:

model = modeling.create_and_train_model( loaded_sim_lib, n_epochs=100, hidden_layer_units_list=[10, 128, 512, 512, 512, 128, 10], activation_list=['relu', 'tanh', 'relu', 'relu', 'relu', 'tanh', 'tanh'], train_batch_size=100, )

it does not work, but gives some errors as given below:

ValueError: Exception encountered when calling ComplexLayer.call().

Could not automatically infer the output shape / dtype of 'complex_layer' (of type ComplexLayer). Either the ComplexLayer.call() method is incorrect, or you need to implement the ComplexLayer.compute_output_spec() / compute_output_shape() method. Error encountered:

Invalid dtype: complex64

Arguments received by ComplexLayer.call(): • args=('<KerasTensor shape=(None, 4), dtype=float32, sparse=False, name=keras_tensor_9>',) • kwargs=<class 'inspect._empty'>

MasSciencer commented 3 weeks ago

I don't remember exactly, but it seems I had such a problem when I tried to use Python 3.12 as an interpreter. Everything started working successfully on Python 3.8

mnadeemakram commented 3 weeks ago

Thanks, I will check this.

Muhammad Nadeem Akram

Professor Faculty of Technology, Natural Sciences and Maritime Sciences Department of Microsystems

Tel: +47 31 00 90 30 @.**@.> www.usn.nohttp://www.usn.no/

@. From: Sergei @.> Sent: Friday, August 16, 2024 11:42 AM To: Luochenghuang/metabox @.> Cc: Muhammad Nadeem Akram @.>; Author @.***> Subject: Re: [Luochenghuang/metabox] issue with model training (Issue #4)

I don't remember exactly, but it seems I had such a problem when I tried to use Python 3.12 as an interpreter. Everything started working successfully on Python 3.8

— Reply to this email directly, view it on GitHubhttps://github.com/Luochenghuang/metabox/issues/4#issuecomment-2293183862, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHWVQNZ3RRFFJPCGDRNVQWTZRXCPLAVCNFSM6AAAAABMRY65E6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJTGE4DGOBWGI. You are receiving this because you authored the thread.Message ID: @.***>

mnadeemakram commented 3 weeks ago

Thanks,

Can we design a doublet with ‘metabox’ package, for example, a double with good performance over a field of view and with achromatic performance.

Thanks,

Muhammad Nadeem Akram

Professor Faculty of Technology, Natural Sciences and Maritime Sciences Department of Microsystems

Tel: +47 31 00 90 30 @.**@.> www.usn.nohttp://www.usn.no/

@. From: Sergei @.> Sent: Friday, August 16, 2024 11:42 AM To: Luochenghuang/metabox @.> Cc: Muhammad Nadeem Akram @.>; Author @.***> Subject: Re: [Luochenghuang/metabox] issue with model training (Issue #4)

I don't remember exactly, but it seems I had such a problem when I tried to use Python 3.12 as an interpreter. Everything started working successfully on Python 3.8

— Reply to this email directly, view it on GitHubhttps://github.com/Luochenghuang/metabox/issues/4#issuecomment-2293183862, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHWVQNZ3RRFFJPCGDRNVQWTZRXCPLAVCNFSM6AAAAABMRY65E6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJTGE4DGOBWGI. You are receiving this because you authored the thread.Message ID: @.***>

MasSciencer commented 2 weeks ago

Thanks, Can we design a doublet with ‘metabox’ package, for example, a double with good performance over a field of view and with achromatic performance. Thanks, Muhammad Nadeem Akram Professor Faculty of Technology, Natural Sciences and Maritime Sciences Department of Microsystems Tel: +47 31 00 90 30 @.**@.> www.usn.no<http://www.usn.no/> @. From: Sergei @.> Sent: Friday, August 16, 2024 11:42 AM To: Luochenghuang/metabox @.> Cc: Muhammad Nadeem Akram @.>; Author @.> Subject: Re: [Luochenghuang/metabox] issue with model training (Issue #4) I don't remember exactly, but it seems I had such a problem when I tried to use Python 3.12 as an interpreter. Everything started working successfully on Python 3.8 — Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHWVQNZ3RRFFJPCGDRNVQWTZRXCPLAVCNFSM6AAAAABMRY65E6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJTGE4DGOBWGI. You are receiving this because you authored the thread.Message ID: @.>

It is possible to make an assembly from several components here. The author shows in examples the possibilities of using this program for conventional refractive optics, but some data will have to be taken from Zemax. Perhaps you should wait for the author's response. I have not used this package for conventional optics yet.

mnadeemakram commented 6 days ago

metabox worked fine with python 3.8, but not with 3.11.