-
Notifications
You must be signed in to change notification settings - Fork 6
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
An error occurred while running the metagrating case #156
Comments
Thanks for reporting this. It seems the Python version specified in the pyproject.toml is incorrect, since I am using some python 3.10 language features. I’ll make an update. Will it be possible for you to use python 3.10 or newer? |
Thank you for your answer. After replacing the python version with 3.10, the program can run normally. In addition, I have tried the given program for optimizing metagrating. I would like to ask whether it can be used to optimize the diffractive splitter ? If yes, how can I modify the program ? challenge = challenges.metagrating() import jax params = challenge.component.init(jax.random.PRNGKey(0)) def loss_fn(params): import invrs_opt opt = invrs_opt.density_lbfgsb(beta=4) @jax.jit Call
|
You should be able to design a diffractive supplier by replacing FYI if you surround your code with triple backticks it will format nicely: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code |
Hello, I made a mistake when I ran the metagrating case of invrs _ gym for the first time. This problem also appeared in other cases. Is there a problem with where I set it ?
Will it be a problem with the python version ? My version of python is 3.8
Here 's my misinformation:
Traceback (most recent call last):
File "D:\BaiduNetdiskDownload\Pycharm Pro 2023\PyCharm 2023.1\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode
coro = func()
File "", line 1, in
File "D:\BaiduNetdiskDownload\Pycharm Pro 2023\PyCharm 2023.1\plugins\python\helpers\pydev_pydev_bundle\pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "D:\BaiduNetdiskDownload\Pycharm Pro 2023\PyCharm 2023.1\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "E:\Object\simulation_up\compare\gym-main\gym-main\src\demo_1.py", line 26, in
from invrs_gym import challenges
File "D:\BaiduNetdiskDownload\Pycharm Pro 2023\PyCharm 2023.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self.system_import(name, *args, **kwargs)
File "E:\Object\simulation_up\compare\gym-main\gym-main\src\invrs_gym_init.py", line 9, in
from invrs_gym import challenges as challenges
File "D:\BaiduNetdiskDownload\Pycharm Pro 2023\PyCharm 2023.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self.system_import(name, *args, **kwargs)
File "E:\Object\simulation_up\compare\gym-main\gym-main\src\invrs_gym\challenges_init.py", line 1, in
from invrs_gym.challenges.bayer.challenge import bayer_sorter as bayer_sorter
File "D:\BaiduNetdiskDownload\Pycharm Pro 2023\PyCharm 2023.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "E:\Object\simulation_up\compare\gym-main\gym-main\src\invrs_gym\challenges\bayer\challenge.py", line 10, in
from fmmax import basis, fmm # type: ignore[import-untyped]
File "D:\BaiduNetdiskDownload\Pycharm Pro 2023\PyCharm 2023.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self.system_import(name, *args, **kwargs)
File "D:\test_code\virtuallab\test_file\lib\site-packages\fmmax_init.py", line 5, in
from . import (
File "D:\BaiduNetdiskDownload\Pycharm Pro 2023\PyCharm 2023.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "D:\test_code\virtuallab\test_file\lib\site-packages\fmmax\fields.py", line 11, in
from fmmax import basis, fft, fmm, scattering, utils
File "D:\BaiduNetdiskDownload\Pycharm Pro 2023\PyCharm 2023.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "D:\test_code\virtuallab\test_file\lib\site-packages\fmmax\fmm.py", line 47, in
formulation: Formulation | VectorFn,
TypeError: unsupported operand type(s) for |: 'EnumMeta' and '_CallableGenericAlias'
The text was updated successfully, but these errors were encountered: