Tensorflow from source master gives a syntax error from import

I tried compiling tensorflow from sources (master) and follow the tensorflow instructions using python3 instead of python2 (and pip defaults to pip3). I can achieve all steps until testing the first model.

I noticed that the problem can be minimally reproduced by doing a simple import tensorflow. The error is as follows:

$ python3 Python 3.5.2 (default, Jul  5 2016, 12:43:10)  [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import tensorflow I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so locally I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so locally I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so locally I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so locally Traceback (most recent call last):   File "<stdin>", line 1, in <module>   File "/usr/local/lib/python3.5/dist-packages/tensorflow/__init__.py", line 23, in <module>     from tensorflow.python import *   File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 65, in <module>     import tensorflow.contrib as contrib   File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/__init__.py", line 30, in <module>     from tensorflow.contrib import learn   File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/__init__.py", line 72, in <module>     from tensorflow.contrib.learn.python.learn import *   File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/__init__.py", line 23, in <module>     from tensorflow.contrib.learn.python.learn import *   File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/__init__.py", line 26, in <module>     from tensorflow.contrib.learn.python.learn import estimators   File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/estimators/__init__.py", line 23, in <module>     from tensorflow.contrib.learn.python.learn.estimators.autoencoder import TensorFlowDNNAutoencoder   File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/estimators/autoencoder.py", line 25, in <module>     from tensorflow.contrib.learn.python.learn.estimators.base import TensorFlowBaseTransformer   File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/estimators/base.py", line 34, in <module>     from tensorflow.contrib.learn.python.learn.estimators import estimator   File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 39, in <module>     from tensorflow.contrib.learn.python.learn.learn_io import data_feeder   File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/learn_io/__init__.py", line 22, in <module>     from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_data   File "/usr/local/lib/python3.5/dist-packages/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py", line 26, in <module>     import dask.dataframe as dd   File "/usr/local/lib/python3.5/dist-packages/dask/__init__.py", line 7, in <module>     from .delayed import do, delayed, value   File "/usr/local/lib/python3.5/dist-packages/dask/delayed.py", line 12, in <module>     from . import base   File "/usr/local/lib/python3.5/dist-packages/dask/base.py", line 287, in <module>     import pandas as pd   File "/usr/local/lib/python3.5/dist-packages/pandas/__init__.py", line 22, in <module>     from pandas.compat.numpy import *   File "/usr/local/lib/python3.5/dist-packages/pandas/compat/__init__.py", line 350, in <module>     from dateutil import parser as _date_parser   File "/usr/local/lib/python3.5/dist-packages/dateutil/parser.py", line 158     l.append("%s=%s" % (attr, `value`))                               ^ SyntaxError: invalid syntax 

Other questions related to similar syntax problems are related to older versions of protobuf, however my version is 3

$ pip3 show protobuf --- Metadata-Version: 2.0 Name: protobuf Version: 3.0.0b2 Summary: Protocol Buffers Home-page: https://developers.google.com/protocol-buffers/ Author: [email protected] Author-email: [email protected] Installer: pip License: New BSD License Location: /usr/local/lib/python3.5/dist-packages Requires: six, setuptools Classifiers:   Programming Language :: Python   Programming Language :: Python :: 2   Programming Language :: Python :: 2.6   Programming Language :: Python :: 2.7   Programming Language :: Python :: 3   Programming Language :: Python :: 3.3   Programming Language :: Python :: 3.4 

How can I solve this problem?

Replay

Category: tensorflow Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.259 (s). 12 q(s)