2017-01-09 42 views
1

喜被調用,Python不能找到模塊,同時用朱古力.prototxt文件作爲輸入層

我有我的輸入數據序列和標籤由sequence_layer.py Python文件構成。然後輸入數據層是:

layer { 
    name: "data" 
    type: "Python" 
    top: "data" 
    top: "label" 
    top: "clip_markers" 
    python_param { 
    module: "sequence_layer" 
    layer: "videoReadTrain_Graylevel" 
    } 
    include: { phase: TRAIN } 
} 

但是,一旦通過我終端運行train.sh,蟒找不到模塊,錯誤是:

... # perilous output are omitted here 
layer { 
    name: "accuracy" 
    type: "Accuracy" 
    bottom: "fc8-final" 
    bottom: "reshape-label" 
    top: "accuracy" 
    accuracy_param { 
    axis: 2 
    } 
} 
I0107 13:50:11.438953 6471 layer_factory.hpp:77] Creating layer data 
Traceback (most recent call last): 
    File "/home/xin/caffe/sequence_layer.py", line 4, in <module> 
    import io 
    File "/usr/lib/python2.7/io.py", line 51, in <module> 
    import _io 
ImportError: No module named _io 
Done. 

但是,如果我在終端中輸入python並導入模塊,它的工作很細:

[email protected]:~/caffe$ python 
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import io 
>>> import caffe 
>>> import numpy 
>>> 

而且我查了PYTHONPATH而sequence_layer.py通過使用「打印(sys.path中)」 .prototxt調用。路徑是正確的。

我使用Ubuntu 14.04LTS和朱古力與/usr/include/python2.7編譯和我沒有設置WITH_PYTHON_LAYER:= 1

任何人有一個解決方案嗎?十分感謝你的幫助。

最佳, 鑫

回答

1

問題通過使用而不是系統默認Python2.7 Anaconda2解決。謝謝。