Je travaille sur le framework Caffe et utilise l'interface PyCaffe. J'utilise un script Python obtenu à partir de la conversion du IPython Notebook 00-classification.ipynb pour tester la classification par un modèle formé pour ImageNet. Mais tout get_ipython() déclaration dans le script donne l'erreur suivante:NameError: le nom 'get_ipython' n'est pas défini
$ 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')
Dans le script, j'importe ce qui suit:
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...
Quelqu'un peut-il s'il vous plaît me aider à résoudre ce Erreur?
où avez-vous importé cela? –
J'ai importé ceci dans le script python où j'essaie d'utiliser l'instruction 'get_ipython()'. –