You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, currently I encounter an error when calling a ME_NeuralFMU` in loss function
function lossSum(p)
global neuralFMU, x₀, params, counter
params = Dict(zip(Vector{String}(modified_Variables), Vector{Float64}(p.value)))
solution = neuralFMU(x₀; parameters=params, p=p, showProgress=true, saveat=tSave, recordValues=vrs) #** this asserts the error message**
if !solution.success
return Inf
end
# id_Net, iq_Net = extractData(solution)
id_Net = fmi2GetSolutionValue(solution, 1; isIndex=true)
iq_Net = fmi2GetSolutionValue(solution, 2; isIndex=true)
loss_value = FMIFlux.Losses.mse(id_Net, id_Data) + FMIFlux.Losses.mse(iq_Net, iq_Data)
return loss_value
end
The error message is:
ERROR: AssertionError: condition!(...): 5 != 3
Function must be called in mode continuous time!
This is most probably because the FMU errored before. If no melected during export) and follow the message printing instru
I am not sure why the status returned by fmi2CompletedIntegratorStep! is 3, is there any suggestion to solve this issue?
If more information is needed, please tell me, thanks!
The text was updated successfully, but these errors were encountered:
Hi, currently I encounter an error when calling a ME_NeuralFMU` in loss function
The error message is:
After tracing the code, I found that this error caused by the assertion in https://github.com/ThummeTo/FMIFlux.jl/blob/main/src/neural.jl#L378, where
c.state=5
butfmi2ComponentStateContinuousTimeMode=3
thus I trace the code to find when the c.state is been changed from 3 to 5, and I found that it occurs at https://github.com/ThummeTo/FMIImport.jl/blob/main/src/FMI2/c.jl#L1937 because the
status
returned byfmi2CompletedIntegratorStep!(c.fmu.cCompletedIntegratorStep, c.addr, noSetFMUStatePriorToCurrentPoint, enterEventMode, terminateSimulation,)
is3
and thus trigger thec.state = fmi2ComponentStateError
in https://github.com/ThummeTo/FMIImport.jl/blob/main/src/FMI2/c.jl#L132 to assign5
toc.state
I am not sure why the
status
returned byfmi2CompletedIntegratorStep!
is3
, is there any suggestion to solve this issue?If more information is needed, please tell me, thanks!
The text was updated successfully, but these errors were encountered: