jonfanlab / glonet Goto Github PK
View Code? Open in Web Editor NEWGlobal optimization based on generative neural networks
License: MIT License
Global optimization based on generative neural networks
License: MIT License
Program error prompt:
GradientFromSolver_1D_parallel
Undefined function 'retio' for input arguments of type 'double'.
Error using GradientFromSolver_1D (line 34)
Undefined function 'retio' for input arguments of type 'double'.
Error in GradientFromSolver_1D_parallel (line 9)
parfor n = 1:N
Is the retio function undefined?
in the repository GLOnet/solvers/Eval_Eff_1D.m, line 17 input for res0 is -1 saying that its for the polarization
parm = res0(-1); % TE polarization. For TM : parm=res0(-1) parm.res1.champ = 1; % the electromagnetic field is calculated accurately %parm.res1.trace = 1; % show the texture
but when I check the reticolo res0.m file the input is supposes to dims and there is a 'pol' in the struct when dim=2
`
if nargin<1;dim=2;end;
if dim==2;% 2 D
sym=struct('x',[],'y',[],'pol',0);
parm1=struct('angles',1,'trace',0,'xlimite',[],'ylimite',[],'nx',100,'ny',100,'calcul',1,'champ',0,'ftemp',1,'fperm',[],'sog',1,'li',1);
else;% 1 D
sym=struct('x',[]);
parm1=struct('trace',0,'xlimite',[],'nx',1000,'calcul',1,'champ',1,'ftemp',0,'fperm',[],'sog',1);
end;
parm2=struct('cals',1,'cale',1,'calef',1,'tolh',1.e-6,'tolb',1.e-6,'retss',3,'retgg',0,'result',1);
parm3=struct('npts',10,'cale',[1:6],'calo',i,'sens',1,'caltab',0,'gauss',0,'gauss_x',10,'gauss_y',nan,'trace',0,'champs',[1:6,0],'apod_champ',0);
parm=struct('dim',dim,'sym',sym,'res1',parm1,'res2',parm2,'res3',parm3);
`
I am a bit confused h
ere if there is any error in the code or my understanding. Please help!!
in GradientFromSolver_1D_parallel
未定义与 'double' 类型的输入参数相对应的函数 'retio'。
Hi, thanks for sharing the code. I encountered the following error while running the code at the training progress of 49%:
File "C:\Users\user\GLOnet\train_and_evaluate.py", line 240, in visualize_generated_images
save_image(imgs_2D, fig_path, n_row, range=(-1, 1))
File "C:\Installation\anaconda3\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "C:\Installation\anaconda3\lib\site-packages\torchvision\utils.py", line 136, in save_image
im.save(fp, format=format)
File "C:\Installation\anaconda3\lib\site-packages\PIL\Image.py", line 2224, in save
if format.upper() not in SAVE:
AttributeError: 'int' object has no attribute 'upper'
I think it could due to the difference in the versions of Python and the libraries, since no library version are written in requirement.txt
.
My python version is 3.8.8 and the library versions are as follows:
GLOnet> pip freeze
colorama==0.4.4
cycler==0.11.0
fonttools==4.28.1
kiwisolver==1.3.2
matplotlib==3.5.0
numpy==1.21.4
packaging==21.2
Pillow==8.4.0
pyparsing==2.4.7
python-dateutil==2.8.2
scipy==1.7.2
setuptools-scm==6.3.2
six==1.16.0
tomli==1.2.2
torch==1.10.0
torchvision==0.11.1
tqdm==4.62.3
typing==3.7.4.3
typing_extensions==4.0.0
Could you please indicate the proper Python/library versions to run the code successfully?
First of all, thank you very much for your excellent work. But I don't know what these functions are for, is there a toolbox involved?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.