Could not load model due to module 'rasa.utils.io' has no attribute 'read_json_file' in Rasa 2.0.2

I am using NLU component of Rasa. I started playing around with latest update of rasa i.e 2.0.2. I trained my model and after training the model, I’m trying to run the NLU server to parse sentence with it using the command: python run --api-enable -m [model_path]. I am getting below error when running server

2020-10-23 02:01:09 ERROR rasa.core.agent - Could not load model due to module ‘rasa.utils.io’ has no attribute ‘read_json_file’.

Is this a known error or is this any bug with the new version? Thanks in advance

Just to check, did you run this command:

python run --api-enable -m [model_path]

Or this one:

rasa run --api-enable -m [model_path]

Also, did you also see a trace attached to this error by any chance?

Sorry my bad I ran

rasa run --api-enable -m [model_path]

I can figure out the issue. I am using one custom extractor where read_json_file was from rasa.utils.io was used. But with the recent rasa update, the project structure has little changes and read_json_file can be obtained from

rasa.shared.utils.io

Now its working. Thanks

1 Like