2015-10-18 132 views
1

我只是想運行的代碼給出有:https://github.com/skaae/lasagne-draw導入錯誤:沒有模塊名爲 - 蟒森蚺

這是下載後的文件烤寬麪條拉主的目錄結構:

lasagne-draw-master\ 

    -->\deepmodels 
     --> __init__.py, batchiterator.py, confusionmatrix.py 
     -->\layers 
      --> __init__.py, draw.py, draw_helpers.py, draw_helpers_test.py 

    -->\examples 
     --> mnist_draw.py, helper_functions.py 

對於安裝我必須在安裝Theano和烤寬麪條後執行這些步驟,如自述文件中所述。我也在lasagne-draw-master目錄。

python setup.py develop 

cd .. 

python -c 'import deepmodels' 

以上兩個命令執行完美。但是,當我執行的第三個命令,它顯示了我這個錯誤:

File "<string>", line 1, in <module> 
File "deepmodels\__init__.py", line 2, in <module> 
    from . import layers 
File "deepmodels\layers\__init__.py", line 1, in <module> 
    from .base import * 
ImportError: No module named base 

deepmodels__init__.py的內容是:

from . import confusionmatrix 
from . import layers 
from . import batchiterator 

deepmodels的內容\ layers__init __ PY是:

from .base import * 
from .draw import * 

我正在使用python anaconda。 init .py文件或其他內容中是​​否存在語法錯誤?

回答

2

我剛纔發現了這些問題,並通過在init.py和draw.py(在圖層目錄中)文件中進行修改來解決這些問題。

deepmodels/init.py 

change followings 

from . import confusionmatrix 
from . import layers 
from . import batchiterator 

to follows; 

import confusionmatrix 
import layers 
import batchiterator 

deepmodels/layers/init.py 

change followings 

from .base import * 
from .draw import * 

to as follows; 

from lasagne.layers.base import * 
from draw import * 

deepmodels/layers/draw.py 

line 8 
comment out from .. import logdists 
相關問題