cancel
Showing results for 
Search instead for 
Did you mean: 

How to import customized model in custom operator

0 Kudos
268

Hi,

I need to import a customized model(from ds.a import CustomFormatter) in my custom operator(test.py). But it shows error: No module named 'ds'

What should I do? Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

jens_rannacher
Explorer
0 Kudos

Hi Zhao,

can you share the Python code here so that I could try to reproduce in my own environment?

Best regards

Jens

jens_rannacher
Explorer
0 Kudos

Dear Zhao,

can you please put a __init__.py file into the custom_operator/ folder and also check if the __init__.py file in the ds/ folder has two under scores at the beginning and the end? From the screenshot it looks like it only has one underscore at the end.

Best regards

Jens

0 Kudos

Hi Jens,

Thanks for your suggestion. I tried it, but it still doesn't work. Anything special I need to add in the code?