AttributeError: 'FDTDGrid' object has no attribute 'updatecoeffsE'

24 views
Skip to first unread message

王辰宇

unread,
Mar 3, 2025, 3:57:54 AMMar 3
to gprMax-users
I got problems when running puthon code on jupyter notebook of colab. Error reports said: "AttributeError: 'FDTDGrid' object has no attribute 'updatecoeffsE'".
I encountered this problem when running :
import run as r;
r.process_folder("./output")
I noticed that errors occurred when it comes to the code line:"api(filename, n=num_scan, gpu={0})",but then I tried running "!python -m gprMax "/content/drive/MyDrive/output/1.in" -n 10 -gpu" directly on jupyter notebook and it worked successfully. Could anyone tell where the problems might be?
Here is the error report by colab:
/content/drive/MyDrive/run.py in process_file(file_path) 59 filename = file_path 60 fi = filename[:-3] ---> 61 api(filename, n=num_scan, gpu={0}) 62 merge_files(fi, removefiles=True) 63 /content/gprMax/gprMax/gprMax.py in api(inputfile, n, task, restart, mpi, mpi_no_spawn, mpicomm, gpu, benchmark, geometry_only, geometry_fixed, write_processed, opt_taguchi) 106 args.opt_taguchi = opt_taguchi 107 --> 108 run_main(args) 109 110 /content/gprMax/gprMax/gprMax.py in run_main(args) 189 if args.task and args.restart: 190 raise GeneralError('Job array and restart modes cannot be used together') --> 191 run_std_sim(args, inputfile, usernamespace) 192 193 /content/gprMax/gprMax/gprMax.py in run_std_sim(args, inputfile, usernamespace, optparams) 230 else: 231 modelusernamespace = usernamespace --> 232 run_model(args, currentmodelrun, modelend - 1, numbermodelruns, inputfile, modelusernamespace) 233 gc.collect() 234 tsimend = timer() /content/gprMax/gprMax/model_build_run.py in run_model(args, currentmodelrun, modelend, numbermodelruns, inputfile, usernamespace) 371 tsolve = solve_cpu(currentmodelrun, modelend, G) 372 else: --> 373 tsolve, memsolve = solve_gpu(currentmodelrun, modelend, G) 374 375 # Write an output file in HDF5 format /content/gprMax/gprMax/model_build_run.py in solve_gpu(currentmodelrun, modelend, G) 506 kernels_fields = SourceModule(kernels_template_fields.substitute(REAL=cudafloattype, COMPLEX=cudacomplextype, N_updatecoeffsE=G.updatecoeffsE.size, N_updatecoeffsH=G.updatecoeffsH.size, NY_MATCOEFFS=G.updatecoeffsE.shape[1], NY_MATDISPCOEFFS=G.updatecoeffsdispersive.shape[1], NX_FIELDS=G.nx + 1, NY_FIELDS=G.ny + 1, NZ_FIELDS=G.nz + 1, NX_ID=G.ID.shape[1], NY_ID=G.ID.shape[2], NZ_ID=G.ID.shape[3] ... 507 else: # Set to one any substitutions for dispersive materials --> 508 kernels_fields = SourceModule(kernels_template_fields.substitute(REAL=cudafloattype, COMPLEX=cudacomplextype, N_updatecoeffsE=G.updatecoeffsE.size, N_updatecoeffsH=G.updatecoeffsH.size, NY_MATCOEFFS=G.updatecoeffsE.shape[1], NY_MATDISPCOEFFS=1, NX_FIELDS=G.nx + 1, NY_FIELDS=G.ny + 1, NZ_FIELDS=G.nz + 1, NX_ID=G.ID.shape[1], NY_ID=G.ID.shape[2], NZ_ID=G.ID.shape[3], NX_T=1, NY_T=1... 509 update_e_gpu = kernels_fields.get_function("update_e") 510 update_h_gpu = kernels_fields.get_function("update_h") AttributeError: 'FDTDGrid' object has no attribute 'updatecoeffsE'

Reply all
Reply to author
Forward
0 new messages