Error when loading UFO model from pickle

Asked by andlessa

Hi,

I'm using MG5 2.9.2 with python 3.8.6 and I'm having issues when using an external model (which worked fine with older MG5 versions).

The first time I import the model everything works fine and I can successfully generate processes and events.
However, when I try to use the model a second time the model gets imported without issues and I can generate processes, but when running "output test" I get the error:

Command "output test" interrupted with error:
UFOError : No module named '<model name>'

I've checked that the issue is related to the pickle file (py3_model.pkl) generated in the first run.
Do you know what I am doing wrong and how I can fix it?

Best,

-Andre

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

Which exact command did you use to load the model?
Where is the model on the disk?
If not inside the models directory, what is your PYTHONPATH environment variable

Is this occurring only for that model or does it happens as well for the "sm" model?

Cheers,

Olivier

> On 23 Feb 2021, at 17:50, andlessa <email address hidden> wrote:
>
> New question #695713 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/695713
>
> Hi,
>
> I'm using MG5 2.9.2 with python 3.8.6 and I'm having issues when using an external model (which worked fine with older MG5 versions).
>
> The first time I import the model everything works fine and I can successfully generate processes and events.
> However, when I try to use the model a second time the model gets imported without issues and I can generate processes, but when running "output test" I get the error:
>
> Command "output test" interrupted with error:
> UFOError : No module named '<model name>'
>
> I've checked that the issue is related to the pickle file (py3_model.pkl) generated in the first run.
> Do you know what I am doing wrong and how I can fix it?
>
> Best,
>
> -Andre
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
andlessa (lessa-a-p) said :
#2

Hi,

I've used:

"import model <model_folder>"

The model seems to be correctly loaded, since I see the model particles and I can generate processes.
Only when running "output" I get an error.

I've tried storing the model folder in the models directory, but I get the same error.
However the same error does not happen for MSSM_SLHA2 for instance.

Cheers,

-Andre

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#3

is <model_folder> an absolute path or a relative one?

if you put in the models folder you can just do
import model NAME
Which will likely fix the issue

Cheers,

Oliviver

> On 23 Feb 2021, at 21:40, andlessa <email address hidden> wrote:
>
> Question #695713 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/695713
>
> Status: Answered => Open
>
> andlessa is still having a problem:
> Hi,
>
> I've used:
>
> "import model <model_folder>"
>
> The model seems to be correctly loaded, since I see the model particles and I can generate processes.
> Only when running "output" I get an error.
>
> I've tried storing the model folder in the models directory, but I get the same error.
> However the same error does not happen for MSSM_SLHA2 for instance.
>
> Cheers,
>
> -Andre
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Can you help with this problem?

Provide an answer of your own, or ask andlessa for more information if necessary.

To post a message you must log in.