Tensorflow: Compatibilité Python 3.7

Créé le 3 juil. 2018  ·  80Commentaires  ·  Source: tensorflow/tensorflow

Je suis sûr que les développeurs travaillent dur pour rattraper Python 3.7.
Y a-t-il un échéancier?

pip3 install tensorflow - ne fonctionne apparemment pas, construit à partir de la source :

Plate-forme et distribution du système d'exploitation : Mac OS X 10.13.5
Python : Python 3.7.0 (Homebrew)
TensorFlow installé à partir de : source (https://github.com/tensorflow/tensorflow.git)
Version de TensorFlow : TensorFlow 1.9.0-rc2
Version Bazel :

Build label: 0.15.0-homebrew
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jun 26 12:42:27 2018 (1530016947)
Build timestamp: 1530016947
Build timestamp as int: 1530016947

Version CUDA/cuDNN : aucune
Modèle de GPU et mémoire : Aucun
Commande exacte à reproduire :
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package

Starting local Bazel server and connecting to it...
...........................
WARNING: /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/BUILD:1992:1: in srcs attribute of cc_library rule @grpc//:grpc_nanopb: please do not import '@grpc//third_party/nanopb:pb_common.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/bazel/grpc_build_system.bzl:172:12
WARNING: /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/BUILD:1992:1: in srcs attribute of cc_library rule @grpc//:grpc_nanopb: please do not import '@grpc//third_party/nanopb:pb_decode.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/bazel/grpc_build_system.bzl:172:12
WARNING: /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/BUILD:1992:1: in srcs attribute of cc_library rule @grpc//:grpc_nanopb: please do not import '@grpc//third_party/nanopb:pb_encode.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/bazel/grpc_build_system.bzl:172:12
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/learn/BUILD:17:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:exporter': No longer supported. Switch to SavedModel immediately.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/learn/BUILD:17:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:gc': No longer supported. Switch to SavedModel immediately.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/timeseries/python/timeseries/BUILD:356:1: in py_library rule //tensorflow/contrib/timeseries/python/timeseries:ar_model: target '//tensorflow/contrib/timeseries/python/timeseries:ar_model' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/timeseries/python/timeseries/state_space_models/BUILD:73:1: in py_library rule //tensorflow/contrib/timeseries/python/timeseries/state_space_models:kalman_filter: target '//tensorflow/contrib/timeseries/python/timeseries/state_space_models:kalman_filter' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/timeseries/python/timeseries/state_space_models/BUILD:230:1: in py_library rule //tensorflow/contrib/timeseries/python/timeseries/state_space_models:filtering_postprocessor: target '//tensorflow/contrib/timeseries/python/timeseries/state_space_models:filtering_postprocessor' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/bayesflow/BUILD:17:1: in py_library rule //tensorflow/contrib/bayesflow:bayesflow_py: target '//tensorflow/contrib/bayesflow:bayesflow_py' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/seq2seq/BUILD:23:1: in py_library rule //tensorflow/contrib/seq2seq:seq2seq_py: target '//tensorflow/contrib/seq2seq:seq2seq_py' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/kfac/python/ops/BUILD:80:1: in py_library rule //tensorflow/contrib/kfac/python/ops:loss_functions: target '//tensorflow/contrib/kfac/python/ops:loss_functions' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/BUILD:14:1: in py_library rule //tensorflow/contrib:contrib_py: target '//tensorflow/contrib:contrib_py' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
INFO: Analysed target //tensorflow/tools/pip_package:build_pip_package (303 packages loaded).
INFO: Found 1 target...
INFO: From Linking external/grpc/libgrpc_base_c.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(endpoint_pair_uv.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(endpoint_pair_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(ev_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(fork_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(gethostname_fallback.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(gethostname_host_name_max.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(iocp_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(iomgr_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(pollset_set_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(pollset_uv.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(pollset_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(resolve_address_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(socket_utils_linux.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(socket_utils_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(socket_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(tcp_client_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(tcp_server_utils_posix_noifaddrs.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(tcp_server_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(tcp_uv.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(tcp_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(timer_uv.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(unix_sockets_posix_noop.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(wakeup_fd_eventfd.o) has no symbols
INFO: From Linking external/grpc/libalts_util.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libalts_util.a(check_gcp_environment_linux.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libalts_util.a(check_gcp_environment_windows.o) has no symbols
INFO: From Linking external/grpc/libtsi.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libtsi.a(ssl_session_openssl.o) has no symbols
INFO: From Linking external/grpc/libgrpc++_base.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc++_base.a(rpc_method.o) has no symbols
INFO: From Linking external/grpc/libgpr_base.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(cpu_iphone.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(cpu_linux.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(cpu_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(env_linux.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(env_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(log_android.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(log_linux.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(log_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(string_util_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(string_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(sync_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(time_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(tls_pthread.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(tmpfile_msys.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(tmpfile_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(wrap_memcpy.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(thd_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(stap_timers.o) has no symbols
INFO: From Linking external/grpc/third_party/address_sorting/libaddress_sorting.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/third_party/address_sorting/libaddress_sorting.a(address_sorting_windows.o) has no symbols
ERROR: /Users/zardoz/Projects/tensorflow/tensorflow/python/BUILD:5315:1: Executing genrule //tensorflow/python:framework/fast_tensor_util.pyx_cython_translation failed (Exit 1)
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/execroot/org_tensorflow/bazel-out/host/bin/external/cython/cython_binary.runfiles/cython/cython.py", line 17, in <module>
    main(command_line = 1)
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Main.py", line 720, in main
    result = compile(sources, options)
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Main.py", line 695, in compile
    return compile_multiple(source, options)
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Main.py", line 666, in compile_multiple
    context = options.create_context()
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Main.py", line 590, in create_context
    self.cplus, self.language_level, options=self)
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Main.py", line 75, in __init__
    from . import Builtin, CythonScope
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/CythonScope.py", line 5, in <module>
    from .UtilityCode import CythonUtilityCode
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/UtilityCode.py", line 3, in <module>
    from .TreeFragment import parse_from_strings, StringParseContext
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/TreeFragment.py", line 17, in <module>
    from .Visitor import VisitorTransform
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Visitor.py", line 15, in <module>
    from . import ExprNodes
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/ExprNodes.py", line 2875
    await = None
          ^
SyntaxError: invalid syntax
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 179.318s, Critical Path: 6.38s
INFO: 413 processes: 413 local.
FAILED: Build did NOT complete successfully
feature

Commentaire le plus utile

@activatedgeek Pardonnez-moi, mais je ne vois pas comment la rétrogradation répond à la question de l'OP concernant la chronologie de la compatibilité de Tensorflow avec Python 3.7 (publié il y a près d'un mois).

Tous les 80 commentaires

Merci pour votre commentaire. Nous avons remarqué que vous n'avez pas rempli le champ suivant dans le modèle de problème. Pourriez-vous les mettre à jour s'ils sont pertinents dans votre cas, ou les laisser comme N/A ? Merci.
Ai-je écrit un code personnalisé
Plate-forme et distribution du système d'exploitation
TensorFlow installé depuis
Version TensorFlow
Version Bazel
Version CUDA/cuDNN
Modèle de GPU et mémoire
Commande exacte à reproduire

Mise à jour du message d'origine comme demandé.

@homofortis Vous pouvez utiliser cela en attendant avec Homebrew pour rétrograder votre version Python.

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

async et await sont maintenant des mots clés et doivent être remplacés dans la base de code TF. Voir https://docs.python.org/3/whatsnew/3.7.html#summary -release-highlights

17022

@activatedgeek Pardonnez-moi, mais je ne vois pas comment la rétrogradation répond à la question de l'OP concernant la chronologie de la compatibilité de Tensorflow avec Python 3.7 (publié il y a près d'un mois).

@homofortis Excuses. J'ai probablement manqué quelques mots là-dedans et j'ai pensé que votre objectif principal était de compiler à partir de la source. De nombreuses recherches menaient à ce problème, j'ai pensé que ce serait bien pour tous ceux qui cherchent à exécuter Tensorflow.

Comme je le vois dans la description, les diagnostics ne sont pas liés à la compatibilité tensorflow avec Python-3.7 mais à l'utilisation d'un Cython trop ancien et actuellement exactement ce problème ne se reproduit pas car Cython mentionné dans l'espace de travail Bazel est suffisamment nouveau. Par contre il y a au moins 2 problèmes de compatibilité Python-3.7 :

  • utilisation du mot-clé async comme nom de variable dans pywrap_tensorflow_internal.py généré à partir de tensorflow/c/eager/c_api.{h,cc} - #20690
  • et rupture causée par le changement du type de retour de $#$3 PyUnicode_AsUTF8AndSize() #$ de char * à const char *
    Peut-être serait-il préférable de mettre ce dernier problème à part.

FWIW, je viens de construire (pas encore testé) tensorflow 1.9 avec MKL sur Windows pour Python 3.7 en utilisant VS2017 et le patch suivant :

diff --git a/tensorflow/c/eager/c_api.h b/tensorflow/c/eager/c_api.h
index 1862af3ce2..093b97110f 100644
--- a/tensorflow/c/eager/c_api.h
+++ b/tensorflow/c/eager/c_api.h
@@ -76,7 +76,7 @@ typedef enum TFE_ContextDevicePlacementPolicy {
 // Sets the default execution mode (sync/async). Note that this can be
 // overridden per thread using TFE_ContextSetAsyncForThread.
 TF_CAPI_EXPORT extern void TFE_ContextOptionsSetAsync(TFE_ContextOptions*,
-                                                      unsigned char async);
+                                                      unsigned char is_async);

 TF_CAPI_EXPORT extern void TFE_ContextOptionsSetDevicePlacementPolicy(
     TFE_ContextOptions*, TFE_ContextDevicePlacementPolicy);
@@ -125,7 +125,7 @@ TFE_ContextGetDevicePlacementPolicy(TFE_Context*);

 // Overrides the execution mode (sync/async) for the current thread.
 TF_CAPI_EXPORT extern void TFE_ContextSetAsyncForThread(TFE_Context*,
-                                                        unsigned char async,
+                                                        unsigned char is_async,
                                                         TF_Status* status);

 // Causes the calling thread to block till all ops dispatched in async mode
diff --git a/tensorflow/core/platform/windows/port.cc b/tensorflow/core/platform/windows/port.cc
index 174f41a993..b06434620e 100644
--- a/tensorflow/core/platform/windows/port.cc
+++ b/tensorflow/core/platform/windows/port.cc
@@ -57,6 +57,11 @@ int NumSchedulableCPUs() {
   return system_info.dwNumberOfProcessors;
 }

+int NumHyperthreadsPerCore() {
+  static const int ht_per_core = tensorflow::port::CPUIDNumSMT();
+  return (ht_per_core > 0) ? ht_per_core : 1;
+}
+
 void* AlignedMalloc(size_t size, int minimum_alignment) {
 #ifdef TENSORFLOW_USE_JEMALLOC
   void* ptr = NULL;
diff --git a/tensorflow/python/eager/pywrap_tfe_src.cc b/tensorflow/python/eager/pywrap_tfe_src.cc
index 6c9481c3af..13edbb07db 100644
--- a/tensorflow/python/eager/pywrap_tfe_src.cc
+++ b/tensorflow/python/eager/pywrap_tfe_src.cc
@@ -813,7 +813,7 @@ char* TFE_GetPythonString(PyObject* o) {
   }
 #if PY_MAJOR_VERSION >= 3
   if (PyUnicode_Check(o)) {
-    return PyUnicode_AsUTF8(o);
+    return (char *)PyUnicode_AsUTF8(o);
   }
 #endif
   return nullptr;
diff --git a/tensorflow/python/lib/core/ndarray_tensor.cc b/tensorflow/python/lib/core/ndarray_tensor.cc
index 9df38d464c..4150fbfdd4 100644
--- a/tensorflow/python/lib/core/ndarray_tensor.cc
+++ b/tensorflow/python/lib/core/ndarray_tensor.cc
@@ -154,7 +154,7 @@ Status PyBytesArrayMap(PyArrayObject* array, F f) {
     if (PyUnicode_Check(item.get())) {
 #if PY_VERSION_HEX >= 0x03030000
       // Accept unicode by converting to UTF-8 bytes.
-      ptr = PyUnicode_AsUTF8AndSize(item.get(), &len);
+      ptr = (char *)PyUnicode_AsUTF8AndSize(item.get(), &len);
       if (!ptr) {
         return errors::Internal("Unable to get element as UTF-8.");
       }
diff --git a/tensorflow/python/lib/core/py_func.cc b/tensorflow/python/lib/core/py_func.cc
index 30c1a9c759..231a66de59 100644
--- a/tensorflow/python/lib/core/py_func.cc
+++ b/tensorflow/python/lib/core/py_func.cc
@@ -322,7 +322,7 @@ Status ConvertNdarrayToTensor(PyObject* obj, Tensor* ret) {
         Py_ssize_t el_size;
         if (PyBytes_AsStringAndSize(input_data[i], &el, &el_size) == -1) {
 #if PY_MAJOR_VERSION >= 3
-          el = PyUnicode_AsUTF8AndSize(input_data[i], &el_size);
+          el = (char *)PyUnicode_AsUTF8AndSize(input_data[i], &el_size);
 #else
           el = nullptr;
           if (PyUnicode_Check(input_data[i])) {

Je préfère ajouter le qualificatif const à la cible au lieu de le supprimer du résultat de PyUnicode_AsUTF8AndSize() . Il s'agit d'une chaîne constante et elle ne doit pas être modifiée.

@asimshankar dit qu'il a examiné et envoyé des relations publiques sur ce sujet. Je vais lui assigner.

Je suis également confronté à des problèmes similaires lors de la construction à partir de la source, en utilisant python 3.7 dans Arch Linux.

ERROR: /home/rharish/.cache/bazel/_bazel_rharish/5d4d7b1255c710f6c814ab2f3f084405/external/protobuf_archive/BUILD:659:1: C++ compilation of rule '@protobuf_archive//:python/google/protobuf/pyext/_message.so' failed (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command 
  (cd /home/rharish/.cache/bazel/_bazel_rharish/5d4d7b1255c710f6c814ab2f3f084405/execroot/org_tensorflow && \
  exec env - \
    LD_LIBRARY_PATH=:/usr/local/lib:/opt/cuda/lib64 \
    PATH=/home/rharish/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/opt/cuda/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl \
    PWD=/proc/self/cwd \
  external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -MD -MF bazel-out/host/bin/external/protobuf_archive/_objs/python/google/protobuf/pyext/_message.so/descriptor_containers.pic.d '-frandom-seed=bazel-out/host/bin/external/protobuf_archive/_objs/python/google/protobuf/pyext/_message.so/descriptor_containers.pic.o' -iquote external/protobuf_archive -iquote bazel-out/host/genfiles/external/protobuf_archive -iquote bazel-out/host/bin/external/protobuf_archive -iquote external/bazel_tools -iquote bazel-out/host/genfiles/external/bazel_tools -iquote bazel-out/host/bin/external/bazel_tools -iquote external/local_config_python -iquote bazel-out/host/genfiles/external/local_config_python -iquote bazel-out/host/bin/external/local_config_python -isystem external/protobuf_archive/python -isystem bazel-out/host/genfiles/external/protobuf_archive/python -isystem bazel-out/host/bin/external/protobuf_archive/python -isystem external/protobuf_archive/src -isystem bazel-out/host/genfiles/external/protobuf_archive/src -isystem bazel-out/host/bin/external/protobuf_archive/src -isystem external/local_config_python/python_include -isystem bazel-out/host/genfiles/external/local_config_python/python_include -isystem bazel-out/host/bin/external/local_config_python/python_include '-std=c++11' -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -fPIC -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -fno-omit-frame-pointer -no-canonical-prefixes -DNDEBUG -g0 -O2 -ffunction-sections -fdata-sections -g0 '-march=native' -g0 -DHAVE_PTHREAD -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function -Wno-writable-strings '-DGOOGLE_PROTOBUF_HAS_ONEOF=1' '-DPROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS=1' -c external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc -o bazel-out/host/bin/external/protobuf_archive/_objs/python/google/protobuf/pyext/_message.so/descriptor_containers.pic.o)
external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc: In function 'bool google::protobuf::python::descriptor::_GetItemByKey(google::protobuf::python::PyContainer*, PyObject*, const void**)':
external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc:69:45: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
        ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc:172:13: note: in expansion of macro 'PyString_AsStringAndSize'
         if (PyString_AsStringAndSize(key, &name, &name_size) < 0) {
             ^~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc:69:45: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
        ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc:189:13: note: in expansion of macro 'PyString_AsStringAndSize'
         if (PyString_AsStringAndSize(key, &camelcase_name, &name_size) < 0) {
             ^~~~~~~~~~~~~~~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option '-Wno-writable-strings'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 63.634s, Critical Path: 9.08s
INFO: 464 processes: 464 local.
FAILED: Build did NOT complete successfully

Ma configuration système est :
Plate-forme et distribution du système d'exploitation : Arch Linux
Python : Python 3.7.0
TensorFlow installé depuis : source (https://github.com/tensorflow/tensorflow.git), branche principale
Version de TensorFlow : TensorFlow 1.9.0
Version Bazel : 0.16.0
Version CUDA/cuDNN : CUDA 9.2
Modèle de GPU et mémoire : NVIDIA GeForce GTX 960M, 4 Go

@bstriner s'est porté volontaire pour mettre à jour le #21202 qui nous amènera un peu plus loin. Mais il semble que nous devrons attendre une version de protobuf avec prise en charge de Python 3.7, puis mettre à jour les dépendances de TensorFlow pour utiliser cette nouvelle version de protobuf.

@rharish101
Si vous utilisez Arch Linux, vous pouvez installer Tensorflow avec pacman-S python-tensorflow .

@rharish101
Si vous avez besoin du support CUDA, vous pouvez installer pacman-S python-tensorflow-cuda

@hzxie Ouais , ça marche bien maintenant ! Comment les gars d'Arch l'ont-ils fait fonctionner ?

Aucune version de protobuf ne prend encore en charge la version 3.7, mais si vous souhaitez utiliser un instantané du maître, vous pouvez créer TF pour la version 3.7.

@bstriner
Je ne peux toujours pas compiler le dernier master. La génération se termine avec des erreurs.

Plate-forme et distribution du système d'exploitation : Mac OS X 10.13.5
Python : Python 3.7.0
TensorFlow installé à partir de : source (https://github.com/tensorflow/tensorflow.git)
Version de TensorFlow : TensorFlow 1.10
Version Bazel : 0.15.2-homebrew
Version CUDA/cuDNN : aucune
Modèle de GPU et mémoire : Aucun
Commande exacte à reproduire :
construction bazel --config=opt //tensorflow/tools/pip_package :build_pip_package

ERROR: /Users/zardoz/Projects/tensorflow/tensorflow/python/eager/BUILD:10:1: C++ compilation of rule '//tensorflow/python/eager:pywrap_tfe_lib' failed (Exit 1)
tensorflow/python/eager/pywrap_tfe_src.cc:219:11: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *'
    char* buf = PyUnicode_AsUTF8AndSize(py_value, &size);
          ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tensorflow/python/eager/pywrap_tfe_src.cc:834:12: error: cannot initialize return object of type 'char *' with an rvalue of type 'const char *'
    return PyUnicode_AsUTF8(o);
           ^~~~~~~~~~~~~~~~~~~
2 errors generated.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 5896.213s, Critical Path: 267.71s
INFO: 2883 processes: 2883 local.
FAILED: Build did NOT complete successfully

@cgohlke Comment construire tensorflow-gpu pour python 3.7 ?

@homofortis c'est parce que ce pr n'est pas encore fusionné. Vous devez le tirer vous-même. https://github.com/tensorflow/tensorflow/pull/21202

Pour extraire les correctifs py37 dans votre référentiel actuel, quelque chose comme ceci :

git remote add bstriner https://github.com/bstriner/tensorflow.git
git fetch bstriner
git merge bstriner/py37

Fondamentalement, si vous rencontrez des problèmes avec la conversion de const char * en char * ou quelque chose de similaire, ce sont les changements dans py37. Correction et discussion dans le PR lié.

@bstriner J'ai besoin d'un fichier de roue de tensorflow gpu pour python 3.7. Je ne peux pas le construire moi-même

Quand est-ce que ce problème est résolu ??

Grâce à la contribution de @bstriner (PR #21202), nous devrions pouvoir construire pour Python 3.7 maintenant. Cependant, comme il y est fait allusion dans le PR, les bibliothèques eigen et protobuf ont encore besoin d'un correctif pour être compilées sous Windows.

@gunan @angersson saurait si la version officielle de TensorFlow 1.11 prendra en charge Python 3.7, ou si vous devrez compiler à partir des sources.

Nous avons toujours un problème sur le côté infra que nous devons résoudre.
Toutes nos infra de construction utilisent ubuntu 14, en raison des demandes de la communauté (pour être compatibles avec ubuntu 14).
Cependant, Python 3.7 n'est pas simple à construire sur Ubuntu 14, car il nécessite des versions mises à jour de quelques bibliothèques fournies avec Ubuntu.

En attendant les correctifs eigen et protobuf sur Windows, nous allons les résoudre.
Mais cela signifie que 1.11 n'aura pas de package prédéfini pour python 3.7

@ SukeshP1995 Vous pouvez essayer cette URL https://www.lfd.uci.edu/~gohlke/pythonlibs/#tensorflow

Existe-t-il des roues GPU Ubuntu 16.04 TensorFlow pour Python 3.7? Ou, si ce n'est pas le cas, pourrais-je obtenir un petit guide pour le construire moi-même ? Je n'ai pas l'expérience nécessaire pour sortir et le faire sans que personne ne me tienne la main :)

@ morenoh149 c'est uniquement pour python 3.6. J'ai 3.7 parce que je viens de faire une nouvelle installation.

https://github.com/tensorflow/tensorflow/issues/20517#issuecomment -418442189 s'applique toujours.
En plus des problèmes d'infra (python 3.7 sur ubuntu 14), toutes nos dépendances ne prennent pas encore en charge python 3.7. Nous travaillons donc toujours avec eux pour passer à python 3.7.

ah non, c'est le problème fondamental @ bjtho08 tensorflow doit cesser d'utiliser les nouveaux mots-clés python en 3.7. C'est de cela qu'il s'agit. En attendant, vous pouvez utiliser les fourches en attente ou utiliser 3.6

@ morenoh149 donc mes options sont de construire une ancienne version de python ou de construire tensorflow à partir de git/master ?

à partir d'aujourd'hui oui. Ce PR https://github.com/tensorflow/tensorflow/pull/21202 est sur master mais une version n'a pas encore été coupée. FWIW vous pouvez utiliser pyenv pour installer de nombreuses versions de python sur un système. Un ingénieur logiciel professionnel devrait être capable d'épingler ses dépendances et ses outils en fonction du projet.

@ morenoh149 @ bjtho08 construire tensorflow à partir de la branche master ne suffit pas. Certaines dépendances ne supportent toujours pas la version 3.7.

@adrianodennanni les dépendances prennent en charge 3.7, mais pas dans les versions publiées. Vous devez remplacer les bibliothèques de l'espace de travail par les masters actuels. Impossible de modifier les dépendances dans tensorflow tant que ces bibliothèques n'ont pas de versions stables.

Donc, pour le protobuf actuel, utilisez ceci :

    PROTOBUF_URLS = [
        "https://mirror.bazel.build/github.com/google/protobuf/archive/a6e1cc7e328c45a0cb9856c530c8f6cd23314163.tar.gz",
        "https://github.com/google/protobuf/archive/a6e1cc7e328c45a0cb9856c530c8f6cd23314163.tar.gz",
    ]
    PROTOBUF_SHA256 = "f785d2009ea7c8484cb0443d9db8fe55f73cfdb6e112bfa659a8a5cdaf664ccd"
    PROTOBUF_STRIP_PREFIX = "protobuf-a6e1cc7e328c45a0cb9856c530c8f6cd23314163"

Vous pourriez également avoir besoin du dernier propre.

@rharish101
Si vous avez besoin du support CUDA, vous pouvez installer pacman-S python-tensorflow-cuda

bien fait merci

à partir d'aujourd'hui oui. Ce PR #21202 est sur le master mais une version n'a pas encore été coupée. FWIW vous pouvez utiliser pyenv pour installer de nombreuses versions de python sur un système. Un ingénieur logiciel professionnel devrait être capable d'épingler ses dépendances et ses outils en fonction du projet.

Merci pour le tuyau, @morenoh149 ! Je l'ai fait fonctionner en recommençant en utilisant pyenv et CUDA 9.0 :)

@gunan

Cependant, Python 3.7 n'est pas simple à construire sur Ubuntu 14, car il nécessite des versions mises à jour de quelques bibliothèques fournies avec Ubuntu.

J'aimerais partager mon expérience dans la construction de Python-3.7 sur Ubuntu 12, et j'espère que cela vous aidera si vous n'avez pas encore résolu ce problème. Je construis en utilisant les drapeaux de configuration suivants :

    --prefix=... \
    --enable-ipv6 \
    --with-dbmliborder=gdbm \
    --with-system-expat \
    --with-computed-gotos \
    --with-system-ffi \
    --with-ensurepip=no

Et la seule bibliothèque système trop obsolète pour Python était OpenSSL, donc le module ssl ne peut pas être construit. Pour résoudre le problème, j'ai décidé de créer OpenSSL à partir de la source et de le lier statiquement à l'aide de la recette cryptography (https://cryptography.io/en/latest/installation/#static-wheels):

  • construisez OpenSSL correctement configuré avec uniquement des bibliothèques statiques :
OPENSSL_VERSION=1.0.2p
wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
tar xf openssl-${OPENSSL_VERSION}.tar.gz
cd openssl-${OPENSSL_VERSION}
./config no-shared no-ssl2 no-ssl3 -fPIC --prefix=$(pwd)/_openssl
make && make install
  • construisez Python en utilisant cet OpenSSL en passant l'indicateur au script configure : --with-openssl=$(pwd)/openssl-${OPENSSL_VERSION}/_openssl , donc l'invocation configure ressemble à :
./configure
    --prefix=... \
    --enable-ipv6 \
    --with-dbmliborder=gdbm \
    --with-system-expat \
    --with-computed-gotos \
    --with-system-ffi \
    --with-ensurepip=no \
    --with-openssl=$(pwd)/openssl-${OPENSSL_VERSION}/_openssl

Outre le problème OpenSSL obsolète, je n'ai pas rencontré de problèmes lors de la construction de Python-3.7 sur l'ancien Ubuntu, j'ai testé ma construction et elle semble fonctionner correctement, les tests à partir de la source Python réussissent.

Nagging Assignees @gunan , @angersson : Cela fait 14 jours sans activité et ce problème a un cessionnaire. Veuillez mettre à jour le libellé et/ou le statut en conséquence.

@bstriner vous avez suggéré de changer PROTOBUF_URLS, PROTOBUF_SHA256 et PROTOBUF_STRIP_PREFIX. Je suppose que vous faites cela dans tensorflow/workspace.bzl ? N'importe où ailleurs? Merci.

En fait, après avoir essayé cela, la version bazel de tensorflow 1.11 donne :

ERREUR : tensorflow/tensorflow/tools/pip_package/ BUILD:216 :1 : erreur lors du chargement du package 'tensorflow' : fichier d'extension introuvable. Impossible de charger le package pour '@bazel_skylib//:lib.bzl' : le référentiel n'a pas pu être résolu et référencé par '//tensorflow/tools/pip_ package:build_pip_package '

@jeffcbecker J'ai aussi eu ce problème. Il semble que l'URL https://mirror.bazel.build/github.com/google/protobuf/archive/a6e1cc7e328c45a0cb9856c530c8f6cd23314163.tar.gz ne soit pas disponible. Quelqu'un a une solution de contournement pour cela?

J'ai pu contourner en utilisant Python 3.6.
Acclamations
Jef
Envoyé depuis mon appareil T-Mobile 4G LTE
-------- Message d'origine --------De : Adriano Dennanni [email protected] Date : 21/10/18 13h40 (GMT-08:00) À : tensorflow/tensorflow [email protected] Cc : jeffcbecker [email protected] , Mention [email protected] Objet : Re : [tensorflow/tensorflow] Compatibilité Python 3.7 (#20517)
@jeffcbecker J'ai aussi eu ce problème. Il semble que l'URL https://mirror.bazel.build/github.com/google/protobuf/archive/a6e1cc7e328c45a0cb9856c530c8f6cd23314163.tar.gz ne soit pas disponible. Quelqu'un a une solution de contournement pour cela?


Vous recevez ceci parce que vous avez été mentionné.
Répondez directement à cet e-mail, consultez-le sur GitHub ou désactivez le fil de discussion.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/tensorflow/tensorflow","titre ":"tensorflow/tensorflow","subtitle":"Référentiel GitHub","main_image_url":" https://assets-cdn.github.com/images/email/message_cards/header.png ","avatar_image_url":" https://assets-cdn.github.com/images/email/message_cards/avatar.png ","action":{"name":"Ouvrir dans GitHub","url":" https://github.com /tensorflow/tensorflow "}},"updates":{"snippets":[{"icon":"PERSON","message":" @adrianodennanni dans #20517 : @jeffcbecker J'ai aussi ce problème. Il semble que le L'URL https://mirror.bazel.build/github.com/google/protobuf/archive/a6e1cc7e328c45a0cb9856c530c8f6cd23314163.tar.gz n'est pas disponible. Quelqu'un a-t-il une solution de contournement ?"}],"action":{"name":"Afficher le problème","url":" https://github.com/tensorflow /tensorflow/issues/20517#issuecomment -431701713"}}}
[
{
"@context": " http://schema.org ",
"@type": "EmailMessage",
"actionpotentielle": {
"@type": "AfficherAction",
"target": " https://github.com/tensorflow/tensorflow/issues/20517#issuecomment -431701713",
"url": " https://github.com/tensorflow/tensorflow/issues/20517#issuecomment -431701713",
"name": "Afficher le problème"
},
"description": "Afficher ce problème sur GitHub",
"éditeur": {
"@type": "Organisation",
"nom": "GitHub",
"url": " https://github.com "
}
},
{
"@type": "MessageCard",
"@context": " http://schema.org/extensions ",
"hideOriginalBody": "faux",
"initiateur": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re : [tensorflow/tensorflow] Compatibilité Python 3.7 (#20517)",
"sections": [
{
"texte": "",
"activityTitle": " Adriano Dennanni ",
"activityImage": " https://assets-cdn.github.com/images/email/message_cards/avatar.png ",
"activitySubtitle": "@adrianodennanni",
"les faits": [

]
}
],
"actionpotentielle": [
{
"name": "Ajouter un commentaire",
"@type": "Carte d'action",
"contributions": [
{
"isMultiLine": vrai,
"@type": "TextEntrée",
"id": "IssueComment",
"isRequired": faux
}
],
"Actions": [
{
"nom": "Commentaire",
"@type": "HttpPOST",
"cible": " https://api.github.com ",
"body": "{n"commandName": "IssueComment",n"repositoryFullName": "tensorflow/tensorflow",n"issueId": 20517,n"IssueComment": "{{IssueComment.value}}"n}"
}
]
},
{
"name": "Fermer le problème",
"@type": "HttpPOST",
"cible": " https://api.github.com ",
"body": "{n"commandName": "IssueClose",n"repositoryFullName": "tensorflow/tensorflow",n"issueId": 20517n}"
},
{
"cibles": [
{
"os": "par défaut",
"uri": " https://github.com/tensorflow/tensorflow/issues/20517#issuecomment -431701713"
}
],
"@type": "OpenUri",
"name": "Voir sur GitHub"
},
{
"name": "Se désinscrire",
"@type": "HttpPOST",
"cible": " https://api.github.com ",
"body": "{n"commandName": "MuteNotification",n"threadId": 352548653n}"
}
],
"themeColor": "26292E"
}
]

protobuf wheel a été mis à jour pour prendre en charge 3.7.

Il est maintenant temps de publier tensorflow pour le support 3.7.

Bonne nouvelle!
Souhaitez-vous envoyer un PR pour supprimer les dépendances du protobuf TF dans l'espace de travail et setup.py ?

Tensorflow est apparemment la dernière pièce manquante de Python-3.7.1. Cela peut avoir un impact sur certaines factures Cloud Electric car Python-3.7 est plus efficace que Python-3.6.

https://github.com/fo40225/tensorflow-windows-wheel/tree/master/1.12.0/py37

Pour tous ceux qui souhaitent tester tensorflow 1.12.0 avec python 3.7 sous Windows.

dépend de protobuf v3.6.0 + cherry-pick https://github.com/protocolbuffers/protobuf/commit/0a59054c30e4f0ba10f10acfc1d7f3814c63e1a7

Cela fait des mois depuis la sortie de la version 3.7, les mises à jour pour TF sont toujours en cours de déploiement, alors quel est le mot/ETA sur la compatibilité ?

L'année 2018 touche donc à sa fin et la version officielle prise en charge par Python 3.7 est toujours une bulle ? :)

La version postée par @adrianodennanni fonctionne pour moi. J'utilise les fonctionnalités de python3.7 dans mon code et c'est une véritable bousculade de changer d'environnement tout le temps.

Pour ce que ça vaut, j'ai pu compiler tf et construire une roue Python3.7 sur OSX en utilisant le maître actuel.

J'ai soumis https://github.com/tensorflow/tensorflow/commit/b0d7d8a477d3041e2d0ebd0cb1d35e4a7fa09663 qui devrait vous permettre de construire pour 3.7. tf-nightly a maintenant une version CPU (Ubuntu uniquement) qui ne fonctionne que sur Ubuntu16.04+. La version GPU pour Ubuntu sera bientôt disponible.

@av8ramit

grâce à vous, je viens de construire avec succès tf avec python 3.7.1, cuda 10 et cudnn 7.4

il ne reste plus que le support bazel 0.20

Les builds tf-nightly-gpu avec CUDA 10 sont également sur pypi maintenant. Je garderai ce bogue ouvert jusqu'à ce que nous ayons une version officielle de Python3.7.

@alanpurple pouvez-vous élaborer? Je ne peux pas construire tf 1.12 pour sauver ma vie sur Ubuntu 18 et python 3.7

Sur les fenêtres :
construit avec succès 1.12-cpu et importé dans py3.7.
mais GPU:
ps : en utilisant bazel 0.21

INFO: From Linking tensorflow/contrib/tpu/python/ops/_tpu_ops.so:
   Creating library bazel-out/x64_windows-opt/bin/tensorflow/contrib/tpu/python/ops/python/ops/lib_tpu_ops.so.ifso and object bazel-out/x64_windows-opt/bin/tensorflow/contrib/tpu/python/ops/python/ops/lib_tpu_ops.so.exp
INFO: From Linking tensorflow/contrib/tensor_forest/python/ops/_stats_ops.so:
   Creating library bazel-out/x64_windows-opt/bin/tensorflow/contrib/tensor_forest/python/ops/python/ops/lib_stats_ops.so.ifso and object bazel-out/x64_windows-opt/bin/tensorflow/contrib/tensor_forest/python/ops/python/ops/lib_stats_ops.so.exp
ERROR: C:/tensorflow/tensorflow/python/keras/api/BUILD:28:1: Executing genrule //tensorflow/python/keras/api:keras_python_api_gen_compat_v1 failed (Exit 1): bash.exe failed: error executing command
  cd C:/users/USER/_bazel_USER/xv6zejqw/execroot/org_tensorflow
  SET CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0
    SET CUDNN_INSTALL_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0
    SET PATH=C:\msys64\usr\bin;C:\msys64\bin
    SET PYTHON_BIN_PATH=C:/Program Files/Python37/python.exe
    SET PYTHON_LIB_PATH=C:/Program Files/Python37/lib/site-packages
    SET TF_CUDA_CLANG=0
    SET TF_CUDA_COMPUTE_CAPABILITIES=3.5,7.0
    SET TF_CUDA_VERSION=10.0
    SET TF_CUDNN_VERSION=7
    SET TF_NEED_CUDA=1
    SET TF_NEED_OPENCL_SYCL=0
    SET TF_NEED_ROCM=0
  C:/msys64/usr/bin/bash.exe -c source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/x64_windows-opt/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen_compat_v1.exe  --apidir=bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api_v1/ --apiname=keras --apiversion=1  --package=tensorflow.python,tensorflow.python.keras --output_package=tensorflow.python.keras.api._v1 bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/activations/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/densenet/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/inception_resnet_v2/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/inception_v3/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/mobilenet/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/mobilenet_v2/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/nasnet/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/resnet50/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/vgg16/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/vgg19/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/xception/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/backend/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/callbacks/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/constraints/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/boston_housing/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/cifar10/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/cifar100/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/fashion_mnist/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/imdb/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/mnist/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/reuters/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/estimator/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/experimental/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/initializers/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/layers/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/losses/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/metrics/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/models/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/optimizers/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/image/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/sequence/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/text/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/regularizers/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/utils/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/wrappers/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/wrappers/scikit_learn/__init__.py
Execution platform: @bazel_tools//platforms:host_platform
Traceback (most recent call last):
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Program Files\Python37\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Program Files\Python37\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\tools\api\generator\create_python_api.py", line 27, in <module>
    from tensorflow.python.tools.api.generator import doc_srcs
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Program Files\Python37\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Program Files\Python37\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 2602.108s, Critical Path: 565.09s
INFO: 4691 processes: 4691 local.
FAILED: Build did NOT complete successfully

Laissez-moi vous dire à quel problème j'ai été confronté et comment je les ai résolus. J'utilise MacOS

Tensorflow n'est pas compatible avec python 3.7, il n'est disponible que pour je pense jusqu'à python 3.6 à partir de maintenant.

J'utilisais python 3.7 donc je télécharge python 3.6 depuis son site officiel... un package d'installation et l'installe. Et épinglez l'application python 3.6 au dock car dès que python 3.7 est dans le lanceur. Python 3.6 ne s'affichera pas .. même s'il s'affichera sur l'onglet de l'application en tant que dossier secondaire

Maintenant, ouvrez le terminal et tapez : nano .bash_profile
Ensuite, un éditeur nano ouvrira le chemin de python 3.6 et commentera le chemin de 3.7. puis appuyez sur control + X puis y pour oui puis sur Entrée

Après cela, redémarrez le terminal et tapez : echo $PATH
Assurez-vous que le premier lien est de python 3.6

Tapez maintenant: python3 et appuyez sur Entrée et vérifiez quelle version s'ouvre juste pour vous assurer qu'il s'agit de python 3.6

Tapez maintenant : python3 -m pip install tensorflow
Vous pouvez télécharger d'autres modules de la même manière.

Maintenant, quand vous voulez travailler avec python 3.6 open. Python du quai. Et travaillez .. et si vous voulez travailler sur 3.7, vous pouvez ouvrir le python 3.7 et cela fonctionnera également couramment

Pour installer des modules en python 3.7,. Tapez simplement : python3.7 -m pip install package namr

Vous avez python3.7.2 très récent compilé pour Windows avec CUDA 10, liens à ce dépôt :
https://github.com/PlatinumLyfe/tf-windows-gpu/

Salut, des progrès sur ce problème de compatibilité?

bbhattmaclap:~ bbhatt$ pip3 install --upgrade tensorflow
Collecter le tenseur de flux
Impossible de trouver une version qui satisfait l'exigence tensorflow (à partir des versions : )
Aucune distribution correspondante trouvée pour tensorflow
bbhattmaclap :~ bbhatt$

@BhuvaneshBhatt, le dernier package officiel tensorflow ne prend pas en charge Python3.7. Vous devrez utiliser votre package tf-nightly-gpu. Nous essayons de l'avoir pour 1.13.

@PlatinumLyfe incapable d'installer.
votre lien n'a que xxx-cp36-cp36m-... .
pas de version cp37 et pas de version -gpu- .

Veuillez cesser de demander à d'autres personnes de fournir des fichiers binaires compilés. En plus de spammer toutes les personnes intéressées par l'arrivée du support officiel de Python 3.7, demander sur une page publiquement commentable à quelqu'un de vous envoyer un binaire à exécuter n'est pas particulièrement sécurisé.

Tensorflow 1.13-rc0 a été publié (https://github.com/tensorflow/tensorflow/releases/tag/v1.13.0-rc0), mais il n'y a pas de version Python 3.7 sur PyPI (https://pypi.org/project /tensorflow/1.13.0rc0/#files). Tensorflow 1.13 sera-t-il officiellement publié pour Python 3.7 ?

Nous visons à essayer d'avoir des binaires python Windows et Ubuntu par rc2 ou l'officiel.

Des nouvelles sur le support Mac? Je suis bloqué sur Mac pour l'instant.
Le 24 janvier 2019, 06h55 -0600, Amit Patankar [email protected] , a écrit :

Nous visons à essayer d'avoir des binaires python Windows et Ubuntu par rc2 ou l'officiel.

Vous recevez ceci parce que vous avez été mentionné.
Répondez directement à cet e-mail, consultez-le sur GitHub ou désactivez le fil de discussion.

Nous avons maintenant un package CPU tf-nightly pour Mac. Je vais essayer d'avoir ça pour rc2 aussi.

Pour tous ceux qui viennent sur ce fil, les packages tf-nightly mentionnés ci-dessus sont bons. Installez-les avec pip3 install tf-nightly pour la version CPU. Testé, fonctionnant sur Python 3.7.2 sur MacOS Mojave 10.14.2

La version 1.13.0rc1 inclut les binaires Python3.7 pour tous les systèmes d'exploitation pour cpu et gpu .

Je n'arrive pas à l'installer. Des étapes de dépannage simples ?
EDIT : Le problème était que la version 32 bits de CPython était utilisée sur un système 64 bits.

@MagixInTheAir Je ferme ce problème car il ne s'agit que de la prise en charge générale de Python 3.7. Veuillez rouvrir un nouveau problème avec les journaux et plus d'informations sur votre configuration si vous rencontrez toujours des problèmes.

Tensorflow 1.13.1 prend désormais en charge Python 3.7.

https://pypi.org/project/tensorflow/#files Il existe des versions cp37 pour tensorflow==1.13.1. Il y a peut-être quelque chose qui ne va pas dans votre environnement.

J'utilise 3.7.2 et j'ai le même problème, la version/les balises signalées pour 1.31.1 sont les suivantes :

{('cp37', 'cp37m', 'manylinux1_x86_64')}

tandis que mon 3.7.2 prend en charge les éléments suivants :

[('cp37', 'cp37m', 'linux_x86_64'), ('cp37', 'abi3', 'linux_x86_64'), ('cp37', 'none', 'linux_x86_64'), ('cp36', 'abi3', 'linux_x86_64'), ('cp35', 'abi3', 'linux_x86_64'), ('cp34', 'abi3', 'linux_x86_64'), ('cp33', 'abi3', 'linux_x86_64'), ('cp32', 'abi3', 'linux_x86_64'), ('py3', 'none', 'linux_x86_64'), ('cp37', 'none', 'any'), ('cp3', 'none', 'any'), ('py37', 'none', 'any'), ('py3', 'none', 'any'), ('py36', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]

(à partir de pep425tags.get_supported())

donc je crois que le problème est juste qu'il devrait y avoir linux non manylinux1 dans le nom de la roue.

J'ai une construction python propre à partir de la source avec des paramètres presque par défaut.

@dellelce , vous utilisez peut-être une très ancienne version de pip ?

import pip._internal; print(pip._internal.pep425tags.get_supported())

me donne de nombreuses balises Linux.

Je viens de vérifier et le problème est avec la construction alpine, ma construction (dellelce/py-base) et l'image alpine officielle du docker (python:alpine) ont le problème alors qu'une image construite sur debian (python:latest) fonctionne bien.
Il doit être lié à la bibliothèque libc utilisée (musl vs glibc) ? Donc, d'autres distributions qui n'utilisent pas la glibc peuvent avoir le problème...

Tous ont le dernier pip et 3.7.3 ou 3.7.2...

Je suis à peu près sûr qu'Alpine n'est pas inclus dans les nombreux Linux pris en charge par manylinux.

@ppwwyyxx devrions-nous avoir un autre ticket pour prendre en charge les distributions Linux non glibc ?

PEP 571/PEP 513 ("manylinux") ne prend en charge que glibc.

@dellelce La prise en charge de linux alpin pourrait être une idée intéressante mais peut ne pas être triviale. Pour le moment, la plupart des binaires tensorflow sont compilés avec Ubuntu 14.04. Même certaines autres plates-formes couramment utilisées (par exemple CentOS) rencontraient parfois des problèmes. Je pense que le support alpin ne sera probablement pas une priorité à court terme.

L'ouverture d'un numéro est toujours une bonne chose, car cela pourrait aider à évaluer le besoin et l'intérêt de la communauté, et cela pourrait toujours être étiqueté comme "contributions bienvenues".

Cette page vous a été utile?
0 / 5 - 0 notes