私はこのコードを使用していました:Tensorflowをインポート中にエラーが発生しました
import tensorflow as tf
これは問題なく動作していました。私は今それをインポートしようとする
、私は次のエラー
In [2]: import tensorflow as tf
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-41389fad42b5> in <module>()
----> 1 import tensorflow as tf
/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py in <module>()
21 from __future__ import print_function
22
---> 23 from tensorflow.python import *
/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py in <module>()
63 from tensorflow.core.util.event_pb2 import *
64 # Import things out of contrib
---> 65 import tensorflow.contrib as contrib
66
67 # Framework
/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/__init__.py in <module>()
28 from tensorflow.contrib import grid_rnn
29 from tensorflow.contrib import layers
---> 30 from tensorflow.contrib import learn
31 from tensorflow.contrib import linear_optimizer
32 from tensorflow.contrib import lookup
/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/__init__.py in <module>()
70
71 # pylint: disable=wildcard-import
---> 72 from tensorflow.contrib.learn.python.learn import *
73 from tensorflow.python.util.all_util import make_all
74
/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/__init__.py in <module>()
21
22 # pylint: disable=wildcard-import
---> 23 from tensorflow.contrib.learn.python.learn import *
/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/__init__.py in <module>()
24 # pylint: disable=wildcard-import
25 from tensorflow.contrib.learn.python.learn import datasets
---> 26 from tensorflow.contrib.learn.python.learn import estimators
27 from tensorflow.contrib.learn.python.learn import graph_actions
28 from tensorflow.contrib.learn.python.learn import learn_io as io
/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/__init__.py in <module>()
21
22 from tensorflow.contrib.learn.python.learn.estimators._sklearn import NotFittedError
---> 23 from tensorflow.contrib.learn.python.learn.estimators.autoencoder import TensorFlowDNNAutoencoder
24 from tensorflow.contrib.learn.python.learn.estimators.base import TensorFlowBaseTransformer
25 from tensorflow.contrib.learn.python.learn.estimators.base import TensorFlowEstimator
/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/autoencoder.py in <module>()
23
24 from tensorflow.contrib.learn.python.learn import models
---> 25 from tensorflow.contrib.learn.python.learn.estimators.base import TensorFlowBaseTransformer
26 from tensorflow.python.ops import nn
27
/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/base.py in <module>()
32 from tensorflow.contrib import layers
33 from tensorflow.contrib.learn.python.learn.estimators import _sklearn
---> 34 from tensorflow.contrib.learn.python.learn.estimators import estimator
35 from tensorflow.contrib.learn.python.learn.estimators._sklearn import NotFittedError
36 from tensorflow.contrib.learn.python.learn.learn_io.data_feeder import setup_train_data_feeder
/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py in <module>()
37 from tensorflow.contrib.learn.python.learn.estimators import tensor_signature
38 from tensorflow.contrib.learn.python.learn.estimators._sklearn import NotFittedError
---> 39 from tensorflow.contrib.learn.python.learn.learn_io import data_feeder
40 from tensorflow.contrib.learn.python.learn.utils import checkpoints
41
/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/learn_io/__init__.py in <module>()
28 from tensorflow.contrib.learn.python.learn.learn_io.graph_io import read_keyed_batch_examples
29 from tensorflow.contrib.learn.python.learn.learn_io.graph_io import read_keyed_batch_features
---> 30 from tensorflow.contrib.learn.python.learn.learn_io.pandas_io import extract_pandas_data
31 from tensorflow.contrib.learn.python.learn.learn_io.pandas_io import extract_pandas_labels
32 from tensorflow.contrib.learn.python.learn.learn_io.pandas_io import extract_pandas_matrix
/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py in <module>()
22 try:
23 # pylint: disable=g-import-not-at-top
---> 24 import pandas as pd
25 HAS_PANDAS = True
26 except ImportError:
/usr/local/lib/python2.7/dist-packages/pandas/__init__.py in <module>()
23
24 try:
---> 25 from pandas import hashtable, tslib, lib
26 except ImportError as e: # pragma: no cover
27 module = str(e).lstrip('cannot import name ') # hack but overkill to use re
/home/kv/pandas/src/numpy.pxd in init pandas.hashtable (pandas/hashtable.c:38364)()
ValueError: numpy.dtype has the wrong size, try recompiling. Expected 88, got 96
を得る私もnumpyのをアップグレードしようとしたが、それは問題を解決していませんでした。 このエラーを解決するお手伝いをしてもらえますか?
EDIT: numpyの(1.8.2) tensorflow(0.10.0rc0) のpython 2.7.6あなたがnumpyのを更新したり、パンダを再コンパイルする必要が
を使用しているので、私もこのエラーが発生したとして、これは役立ちます](http://stackoverflow.com/questions/26067692/numpy-dtype-has-the-wrong-size-try-recompiling)、問題はPythonがnumpyの間違ったバージョンを指していたことでした。この場合、あなたはそれを否定しましたか? –
私はnumpy(1.8.2)のバージョンは1つしかなく、tensorflowのインポートはうまくいきました。numpyのバージョンは変更されていません。 – djvu