我在python中有以下目录结构。你知道吗
├── mel2samp.py
├── tacotron2
│ ├── layers.py
在mel2中山梨我想使用这些代码行从tacatron2.layers导入TacotronSTFT
import sys
sys.path.insert(0, 'tacotron2')
from tacotron2.layers import TacotronSTFT
但它抛出了一个错误
ImportError: No module named tacotron2.layers
。你知道吗
Tags:
您可以通过添加
__init__.py
你可以阅读更多关于它here
但建议通过添加初始.py你知道吗
然后你就可以用它来
from tacotron2.layers import TacotronSTFT #Use TacotronSTFT
在
tacotron2
文件夹中还需要一个空的__init__.py
文件。之后你可以做:相关问题 更多 >
编程相关推荐