Hi,
I call the constructor of an custom python package, which I import with pyimport. Somehow it works when I do it in a script, but if I put the code into a module, it will throw an error “ArgumentError: ref of NULL PyObject”. Has anybody an idea what could be the reason?
Script:
DataPreProPython = pyimport("damo.modeling.dataprepro")
KerasIdentification = pyimport("damo.modeling.keras_identification")
data = DataPreProPython.DataPrePro(data_train, data_type="time_series", normalize_flag=false, data_val=data_val, num_overlap=N_overlap)
keras_identification = KerasIdentification.KerasIdentification(data, num_neurons, layer_types, list_activations, num_epochs,
patience, file_path,
verbose, optimizer, learning_rate, batch_size)
keras_identification.train()
Module:
module TestModulePyCall
using PyCall
DataPreProPython = pyimport("damo.modeling.dataprepro")
KerasIdentification = pyimport("damo.modeling.keras_identification")
function train(data_train, data_val, N_overlap, num_neurons, layer_types, list_activations, num_epochs,
patience, file_path,
verbose, optimizer, learning_rate, batch_size)
data = DataPreProPython.DataPrePro(data_train, data_type="time_series", normalize_flag=false, data_val=data_val, num_overlap=N_overlap)
keras_identification = KerasIdentification.KerasIdentification(data, num_neurons, layer_types, list_activations, num_epochs,
patience, file_path,
verbose, optimizer, learning_rate, batch_size)
keras_identification.train()
end
end # module TestModulePyCall