Sto lavorando su Caffe framework e sull'interfaccia PyCaffe. Sto usando uno script Python ottenuto dalla conversione del Notebook IPython 00-classification.ipynb per testare la classificazione con un modello addestrato per ImageNet. Ma ogni get_ipython() dichiarazione nello script sta dando il seguente errore:NameError: nome 'get_ipython' non definito
$ python python/my_test_imagenet.py
Traceback (most recent call last):
File "python/my_test_imagenet.py", line 23, in <module>
get_ipython().magic(u'matplotlib inline')
Nello script, sto importando il seguente:
import numpy as np
import matplotlib.pyplot as plt
get_ipython().magic(u'matplotlib inline')
# Make sure that caffe is on the python path:
caffe_root = '/path/to/caffe/'
import sys
sys.path.insert(0, caffe_root + 'python')
import caffe
plt.rcParams['figure.figsize'] = (10, 10)
plt.rcParams['image.interpolation'] = 'nearest'
plt.rcParams['image.cmap'] = 'gray'
import os
# ... Rest of the code...
Qualcuno può aiutarmi a risolvere questo errore?
dove l'hai importato? –
L'ho importato nello script python dove sto cercando di usare l'istruzione 'get_ipython()'. –