October 21, 2022 at 1:16 amWenyi ZhangSubscriberHi all,Our research group wants to use the inverse design function of Lumerical and we started with the example - 2D Ysplitter problem in the Lumerical example gallery. We are referring to this tutorial: the https://lumopt.readthedocs.io/en/latest/tutorial.htmlWe keep encountering issues when running the splitter_opt_2D.py file. Here is what I did to install LumOpt and run the file.I typed all of these commands in a VSCode terminal on a windows10 desktop and I am using python3 and the latest version of Lumerical.1. First, I entered the directory where lumapi locates with the command:cd "C:\Program Files\Lumerical|v222\api\python"2. then I cloned the github repo mentioned in the tutorial by:After this operation, I could see I have LumOpt under "C:\Program Files\Lumerical|v222\api\python"3.Then I enter the LumOpt folder with:cd "C:\Program Files\Lumerical\v222\api\python\LumOpt"and run the setup file with:python setup.py develop --install-dir 'C:\Program Files\Lumerical\v222\api\python\LumOpt'From the output information, I can see all of the package requirements are satisfied.4.To make sure the splitter_opt_2D.py can import the packages from lumopt successfully, I add two lines in the splitter_opt_2D.py, which are:sys.path.append("C:\\Program Files\\Lumerical\\v222\\api\\python\\")sys.path.append("C:\\Program Files\\Lumerical\\v222\\api\\python\\LumOpt\\")and I tried to run splitter_opt_2D.py with the command:python 'C:\Program Files\Lumerical\v222\api\python\LumOpt\examples\Ysplitter\splitter_opt_2D.py'5. I can see the Lumerical window opens but after some quick initialization, an error was reported:AttributeError: 'SnapShots' object has no attribute '_tmpdir'and the Lumerical window quited quickly.Any help will be highly appreciated!
October 21, 2022 at 9:41 pmTaylor RobertsonAnsys Employee
This sounds to me like it may be an issue with your Python environment. It should be easy to check using the python version we ship with. Simply run the splitter python code from the script editor in Lumerical.
This is a more upt to date example, I would suggest you use. Just open the python file and click run.
Also ther is no need to clone that git library you mentioned, we ship a version of lumapi, lumopt and python. This directory in windows should have a newer slightly different version of LumOpt then that found on Git. That version is witten for 3.6 I believe, but Lumerical version 2022 has updated to 3.9. You may need to reinstall Lumerical to return to the version of lumopt that we ship with, as doubt these variations will work together.
Let us know how it works out and if you have any further issues.
October 24, 2022 at 4:23 pmWenyi ZhangSubscriber
Thank you so much for the info and what you said is really the key. After I deleted all the files I cloned from the github and reinstalled Lumerical, I can run the python code in Lumerical without any problems. Results look good for me! :)
- You must be logged in to reply to this topic.
Simulation World 2022
Earth Rescue – An Ansys Online Series
- “Import optical generation” or “delta generation rate”?
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Error on Lumerical device
- Using a license file on a new license server
- Ansys Insight: Diverging Simulations
- Ansys Insight: About override mesh in FDTD: its use and settings
- Error: addfdtd is not a valid function or a variable name
- Ansys Insight: Convergence issues in CHARGE
- Ansys Insight: Transmission results greater than one
- Is there a Lumerical script command to output the Simulation and Memory requirements?
© 2022 Copyright ANSYS, Inc. All rights reserved.