Closed advaitb closed 5 months ago
I've been seeing these lengthy error trace on my M1 as well upgrading to julia 1.10, I'm not quite sure why. I have tried to look a bit into it but it is a very intriguing error message. Weirdest part is that it looks like it still runs fine despite the error message if you just ignore it.
I'll keep an eye on this issue and investigate more to see if I can find the source of it
Thanks for your help, Matthias. It is indeed weird that it seems to run fine, however I went ahead and tried to plot the FWI first gradient and it looks like something definitely got messed up.
fig = figure(figsize=(7,13))
imshow(reshape(g, model.n)', vmin=-1e3, vmax=1e3, extent=(0,10,3,0), cmap="jet")
title("FWI first gradient")
xlabel("Lateral position [km]");
ylabel("Depth [km]");
display(fig)
This is becasue you compute the gradient in the true model so the residual is zero (minus numerical accuracy) so it's basically zero gradient
@advaitb just wondering, wich OS do you use and what distribution?
@mloubout Gotcha, let me try it with a different model as given in the example.
@kerim371 I'm running this on AWS so Amazon Linux '23 (RHEL).
@mloubout I ran the script with a new defined model0 for optimization which I calculated as follows:
vp0 = 1f0*ones(Float32, shape)
vp0[:, 45:120] .= 0.25f0
vp0[:, 120:165] .= 3f0
vp0[:, 165:end] .= 2.5f0
model0 = Model((201, 201), (10,10), (0,0), 1f0./vp0.^2f0; nb = 80)
This is different from the model I defined above to generate the seismic data and I also modified the FWI objective to resemble the example in the notebook:
# NLopt objective function
function objf!(x, grad)
if count == 0
@printf("%10s %15s %15s\n","Iteration","Function Val","norm(g)")
end
# Update model
model0.m .= Float32.(reshape(x, model0.n))
# Seclect batch and calculate gradient
i = randperm(d_obs.nsrc)[1:batchsize]
fval, gradient = fwi_objective(model0, q[i], d_obs[i])
# Reset gradient in water column to zero
gradient = reshape(gradient, model0.n)
gradient[:,1:21] .= 0f0
if length(grad) > 0
grad[1:end] = vec(gradient)
end
global count += 1
@printf("%10d %15.5e %15.5e\n",count, fval, norm(g))
return convert(Float64, fval)
end
g = zeros(prod(model0.n))
f0 = objf!(vec(model0.m), g)
global count = 0;
The output of the FWI first gradient unfortunately is still the same as before so that doesn't seem to work for me. Do let me know if there is something else I'm missing. Also still getting the pesky internal error but that's best ignored for now.
There was a typo in a type definition leading to the error message, fixed in latest master and will be in the next release
Hi,
I'm basically trying to replicate examples 1 and 2 from the notebooks and executing the code below:
However, running
f0 = objf!(vec(model0.m), g)
gives me an error. I'm running Julia 1.10. The full error trace is attached below. Could you please point to where the issue is? Thanks! judi_error.txt