ModuleNotFoundError: No module named ‘__main__.darknet‘; ‘__main__‘ is not a package

An error occurs when importing files in the same directory: ModuleNotFoundError: No module named '__main__.darknet'; '__

main__' is not a package

Solution:

first step:

Write picture description here

Step two:

Remove the '.' in from .darknet import BaseConv, CSPDarknet, CSPLayer, DWConv and 
change it to: from darknet import BaseConv, CSPDarknet, CSPLayer, DWConv

Guess you like

Origin blog.csdn.net/weiyuangong/article/details/124994025