theano.printing.pydotprint() 関数を使用するとエラーが発生します
次の行はエラーなしで正常に機能します。
>>> from theano import *
>>> import theano.tensor as T
>>> import pydot
>>> import numpy
走るときも
>>> theano.printing.pydotprint
Pythonインタープリターでは、次のように出力されます
<function pydotprint at 0x307ed70>
しかし、問題は、関数を使用してスクリプトを実行すると、次のエラーが発生することです
RuntimeError: Failed to import pydot. You must install pydot for `pydotprint` to work.
何が問題なのですか?
PS: ここで与えられた python チュートリアルを実行しています: http://deeplearning.net/software/theano/tutorial/printing_drawing.html したがって、関数の呼び出しは確かに正しいです。
私が得ているエラーのトレースバックは次のとおりです。
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
173 else:
174 filename = fname
--> 175 __builtin__.execfile(filename, *where)
/home/abhishek/Desktop/Theano/test2.py in <module>()
64 if not os.path.exists('pics'):
65 os.mkdir('pics')
---> 66 theano.printing.pydotprint(predict,outfile="pics/logreg_pydotprint_predic.png",var_with_name_simple=True)
67 # before compilation
68 theano.printing.pydotprint_variables(prediction,outfile="pics/logreg_pydotprint_prediction.png",var_with_name_simple=True)
/usr/local/lib/python2.7/dist-packages/theano/printing.pyc in pydotprint(fct, outfile, compact, format, with_ids, high_contrast, cond_highlight, colorCodes, max_label_size, scan_graphs, var_with_name_simple, print_output_file, assert_nb_all_strings)
566
567 if not pydot_imported:
--> 568 raise RuntimeError("Failed to import pydot. You must install pydot"
569 " for `pydotprint` to work.")
570 return
RuntimeError: Failed to import pydot. You must install pydot for `pydotprint` to work.