conda-forge / tensorflow-feedstock

A conda-smithy repository for tensorflow.
BSD 3-Clause "New" or "Revised" License
92 stars 81 forks source link

tensorflow 2.6 packages are broken (linux-64) #135

Closed 183amir closed 2 years ago

183amir commented 3 years ago

I am testing a simple TensorFlow program taken from the website but looks like the packages are broken. I have tested on linux-64 python 3.8 and 3.9:

$ mamba create -n tf26 python=3.8 tensorflow

Looking for: ['python=3.8', 'tensorflow']

conda-forge/linux-64     Using cache
conda-forge/noarch       Using cache
Transaction

  Prefix: ~/miniconda/envs/tf26

  Updating specs:

   - python=3.8
   - tensorflow

  Package                         Version  Build                   Channel                    Size
────────────────────────────────────────────────────────────────────────────────────────────────────
  Install:
────────────────────────────────────────────────────────────────────────────────────────────────────

  + _libgcc_mutex                     0.1  conda_forge             conda-forge/linux-64     Cached
  + _openmp_mutex                     4.5  1_gnu                   conda-forge/linux-64     Cached
  + abseil-cpp                 20210324.2  h9c3ff4c_0              conda-forge/linux-64     Cached
  + absl-py                        0.14.1  pyhd8ed1ab_0            conda-forge/noarch        98 KB
  + aiohttp                   3.7.4.post0  py38h497a2fe_0          conda-forge/linux-64     Cached
  + astor                           0.8.1  pyh9f0ad1d_0            conda-forge/noarch       Cached
  + astunparse                      1.6.3  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + async-timeout                   3.0.1  py_1000                 conda-forge/noarch       Cached
  + attrs                          21.2.0  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + blinker                           1.4  py_1                    conda-forge/noarch       Cached
  + brotlipy                        0.7.0  py38h497a2fe_1001       conda-forge/linux-64     Cached
  + c-ares                         1.17.2  h7f98852_0              conda-forge/linux-64     Cached
  + ca-certificates             2021.5.30  ha878542_0              conda-forge/linux-64     Cached
  + cached-property                 1.5.2  hd8ed1ab_1              conda-forge/noarch       Cached
  + cached_property                 1.5.2  pyha770c72_1            conda-forge/noarch       Cached
  + cachetools                      4.2.4  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + certifi                     2021.5.30  py38h578d9bd_0          conda-forge/linux-64     Cached
  + cffi                           1.14.6  py38h3931269_1          conda-forge/linux-64     Cached
  + chardet                         4.0.0  py38h578d9bd_1          conda-forge/linux-64     Cached
  + charset-normalizer              2.0.0  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + click                           8.0.1  py38h578d9bd_0          conda-forge/linux-64     Cached
  + cryptography                    3.4.7  py38ha5dfef3_0          conda-forge/linux-64     Cached
  + dataclasses                       0.8  pyhc8e2a94_3            conda-forge/noarch       Cached
  + gast                            0.4.0  pyh9f0ad1d_0            conda-forge/noarch       Cached
  + giflib                          5.2.1  h36c2ea0_2              conda-forge/linux-64     Cached
  + google-auth                    1.35.0  pyh6c4a22f_0            conda-forge/noarch       Cached
  + google-auth-oauthlib            0.4.6  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + google-pasta                    0.2.0  pyh8c360ce_0            conda-forge/noarch       Cached
  + grpc-cpp                       1.37.1  hfc4d69e_3              conda-forge/linux-64     Cached
  + grpcio                         1.37.1  py38hdd6454d_0          conda-forge/linux-64     Cached
  + h5py                            3.1.0  nompi_py38hafa665b_100  conda-forge/linux-64     Cached
  + hdf5                           1.10.6  nompi_h6a2412b_1114     conda-forge/linux-64     Cached
  + icu                              68.1  h58526e2_0              conda-forge/linux-64     Cached
  + idna                              3.1  pyhd3deb0d_0            conda-forge/noarch       Cached
  + importlib-metadata              4.8.1  py38h578d9bd_0          conda-forge/linux-64     Cached
  + jpeg                               9d  h36c2ea0_0              conda-forge/linux-64     Cached
  + keras                           2.6.0  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + keras-preprocessing             1.1.2  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + krb5                           1.19.2  hcc1bbae_2              conda-forge/linux-64     Cached
  + ld_impl_linux-64               2.36.1  hea4e1c9_2              conda-forge/linux-64     Cached
  + libblas                         3.9.0  11_linux64_openblas     conda-forge/linux-64     Cached
  + libcblas                        3.9.0  11_linux64_openblas     conda-forge/linux-64     Cached
  + libcurl                        7.79.1  h2574ce0_1              conda-forge/linux-64     Cached
  + libedit                  3.1.20191231  he28a2e2_2              conda-forge/linux-64     Cached
  + libev                            4.33  h516909a_1              conda-forge/linux-64     Cached
  + libffi                          3.4.2  h9c3ff4c_4              conda-forge/linux-64     Cached
  + libgcc-ng                      11.2.0  h1d223b6_9              conda-forge/linux-64     Cached
  + libgfortran-ng                 11.2.0  h69a702a_9              conda-forge/linux-64     Cached
  + libgfortran5                   11.2.0  h5c6108e_9              conda-forge/linux-64     Cached
  + libgomp                        11.2.0  h1d223b6_9              conda-forge/linux-64     Cached
  + liblapack                       3.9.0  11_linux64_openblas     conda-forge/linux-64     Cached
  + libnghttp2                     1.43.0  h812cca2_1              conda-forge/linux-64     Cached
  + libopenblas                    0.3.17  pthreads_h8fe5266_1     conda-forge/linux-64     Cached
  + libpng                         1.6.37  h21135ba_2              conda-forge/linux-64     Cached
  + libprotobuf                    3.15.8  h780b84a_1              conda-forge/linux-64     Cached
  + libssh2                        1.10.0  ha56f1ee_2              conda-forge/linux-64     Cached
  + libstdcxx-ng                   11.2.0  he4da1e4_9              conda-forge/linux-64     Cached
  + libzlib                        1.2.11  h36c2ea0_1013           conda-forge/linux-64     Cached
  + markdown                        3.3.4  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + multidict                       5.2.0  py38h497a2fe_0          conda-forge/linux-64     Cached
  + ncurses                           6.2  h58526e2_4              conda-forge/linux-64     Cached
  + numpy                          1.19.5  py38h9894fe3_2          conda-forge/linux-64     Cached
  + oauthlib                        3.1.1  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + openssl                        1.1.1l  h7f98852_0              conda-forge/linux-64     Cached
  + opt_einsum                      3.3.0  pyhd8ed1ab_1            conda-forge/noarch       Cached
  + pip                            21.2.4  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + protobuf                       3.15.8  py38h709712a_0          conda-forge/linux-64     Cached
  + pyasn1                          0.4.8  py_0                    conda-forge/noarch       Cached
  + pyasn1-modules                  0.2.7  py_0                    conda-forge/noarch       Cached
  + pycparser                        2.20  pyh9f0ad1d_2            conda-forge/noarch       Cached
  + pyjwt                           2.1.0  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + pyopenssl                      21.0.0  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + pysocks                         1.7.1  py38h578d9bd_3          conda-forge/linux-64     Cached
  + python                         3.8.12  hb7a2778_1_cpython      conda-forge/linux-64     Cached
  + python-flatbuffers               1.12  pyhd8ed1ab_1            conda-forge/noarch       Cached
  + python_abi                        3.8  2_cp38                  conda-forge/linux-64     Cached
  + pyu2f                           0.1.5  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + re2                        2021.08.01  h9c3ff4c_0              conda-forge/linux-64     Cached
  + readline                          8.1  h46c0cb4_0              conda-forge/linux-64     Cached
  + requests                       2.26.0  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + requests-oauthlib               1.3.0  pyh9f0ad1d_0            conda-forge/noarch       Cached
  + rsa                             4.7.2  pyh44b312d_0            conda-forge/noarch       Cached
  + scipy                           1.7.1  py38h56a6a73_0          conda-forge/linux-64     Cached
  + setuptools                     58.2.0  py38h578d9bd_0          conda-forge/linux-64     Cached
  + six                            1.15.0  pyh9f0ad1d_0            conda-forge/noarch       Cached
  + snappy                          1.1.8  he1b5a44_3              conda-forge/linux-64     Cached
  + sqlite                         3.36.0  h9cd32fc_2              conda-forge/linux-64     Cached
  + tensorboard                     2.6.0  pyhd8ed1ab_1            conda-forge/noarch       Cached
  + tensorboard-data-server         0.6.0  py38h3e25421_0          conda-forge/linux-64     Cached
  + tensorboard-plugin-wit          1.8.0  pyh44b312d_0            conda-forge/noarch       Cached
  + tensorflow                      2.6.0  py38h578d9bd_0          conda-forge/linux-64     Cached
  + tensorflow-base                 2.6.0  py38h83f5f1d_0          conda-forge/linux-64     Cached
  + tensorflow-estimator            2.6.0  py38h709712a_0          conda-forge/linux-64     Cached
  + termcolor                       1.1.0  py_2                    conda-forge/noarch       Cached
  + tk                             8.6.11  h27826a3_1              conda-forge/linux-64     Cached
  + typing-extensions             3.7.4.3  0                       conda-forge/noarch       Cached
  + typing_extensions             3.7.4.3  py_0                    conda-forge/noarch       Cached
  + urllib3                        1.26.7  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + werkzeug                        2.0.1  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + wheel                          0.37.0  pyhd8ed1ab_1            conda-forge/noarch       Cached
  + wrapt                          1.12.1  py38h497a2fe_3          conda-forge/linux-64     Cached
  + xz                              5.2.5  h516909a_1              conda-forge/linux-64     Cached
  + yarl                            1.6.3  py38h497a2fe_2          conda-forge/linux-64     Cached
  + zipp                            3.6.0  pyhd8ed1ab_0            conda-forge/noarch       Cached
  + zlib                           1.2.11  h36c2ea0_1013           conda-forge/linux-64     Cached

  Summary:

  Install: 105 packages

  Total download: 98 KB

────────────────────────────────────────────────────────────────────────────────────────────────────

Confirm changes: [Y/n] 
Finished absl-py                              (00m:00s)              98 KB    343 KB/s
Downloading  [====================================================================================================] (00m:00s)  338.89 KB/s
Extracting   [====================================================================================================] (00m:00s)        1 / 1
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate tf26
#
# To deactivate an active environment, use
#
#     $ conda deactivate

$ conda activate tf26
(tf26) $ which python
~/miniconda/envs/tf26/bin/python
(tf26) $ python
Python 3.8.12 | packaged by conda-forge | (default, Sep 29 2021, 19:52:28) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> mnist = tf.keras.datasets.mnist
>>> 
>>> (x_train, y_train),(x_test, y_test) = mnist.load_data()
>>> x_train, x_test = x_train / 255.0, x_test / 255.0
>>> 
>>> model = tf.keras.models.Sequential([
...   tf.keras.layers.Flatten(input_shape=(28, 28)),
...   tf.keras.layers.Dense(128, activation='relu'),
...   tf.keras.layers.Dropout(0.2),
...   tf.keras.layers.Dense(10, activation='softmax')
... ])
2021-10-07 17:33:45.742158: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/training/tracking/base.py", line 530, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/keras/engine/sequential.py", line 107, in __init__
    super(functional.Functional, self).__init__(  # pylint: disable=bad-super-call
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/training/tracking/base.py", line 530, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/keras/engine/training.py", line 289, in __init__
    self._init_batch_counters()
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/training/tracking/base.py", line 530, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/keras/engine/training.py", line 297, in _init_batch_counters
    self._train_counter = tf.Variable(0, dtype='int64', aggregation=agg)
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 268, in __call__
    return cls._variable_v2_call(*args, **kwargs)
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 250, in _variable_v2_call
    return previous_getter(
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 243, in <lambda>
    previous_getter = lambda **kws: default_variable_creator_v2(None, **kws)
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/variable_scope.py", line 2662, in default_variable_creator_v2
    return resource_variable_ops.ResourceVariable(
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 270, in __call__
    return super(VariableMetaclass, cls).__call__(*args, **kwargs)
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 1602, in __init__
    self._init_from_args(
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 1756, in _init_from_args
    handle = eager_safe_variable_handle(
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 238, in eager_safe_variable_handle
    return _variable_handle_from_shape_and_dtype(shape, dtype, shared_name, name,
  File "~/miniconda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 178, in _variable_handle_from_shape_and_dtype
    cpp_shape_inference_pb2.CppShapeInferenceResult.HandleShapeAndType(
TypeError: Parameter to MergeFrom() must be instance of same class: expected tensorflow.TensorShapeProto got tensorflow.TensorShapeProto.

(tf26) $ 
(tf26) $ conda deactivate
$ conda env remove -yn tf26

Remove all packages in environment ~/miniconda/envs/tf26:

$ mamba create -n tf26 python=3.9 tensorflow

Looking for: ['python=3.9', 'tensorflow']

conda-forge/linux-64     Using cache
conda-forge/noarch       Using cache
Transaction

  Prefix: ~/miniconda/envs/tf26

  Updating specs:

   - python=3.9
   - tensorflow

  Package                         Version  Build                   Channel                     Size
─────────────────────────────────────────────────────────────────────────────────────────────────────
  Install:
─────────────────────────────────────────────────────────────────────────────────────────────────────

  + _libgcc_mutex                     0.1  conda_forge             conda-forge/linux-64      Cached
  + _openmp_mutex                     4.5  1_gnu                   conda-forge/linux-64      Cached
  + abseil-cpp                 20210324.2  h9c3ff4c_0              conda-forge/linux-64      Cached
  + absl-py                        0.14.1  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + aiohttp                   3.7.4.post0  py39h3811e60_0          conda-forge/linux-64      624 KB
  + astor                           0.8.1  pyh9f0ad1d_0            conda-forge/noarch        Cached
  + astunparse                      1.6.3  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + async-timeout                   3.0.1  py_1000                 conda-forge/noarch        Cached
  + attrs                          21.2.0  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + blinker                           1.4  py_1                    conda-forge/noarch        Cached
  + brotlipy                        0.7.0  py39h3811e60_1001       conda-forge/linux-64      Cached
  + c-ares                         1.17.2  h7f98852_0              conda-forge/linux-64      Cached
  + ca-certificates             2021.5.30  ha878542_0              conda-forge/linux-64      Cached
  + cached-property                 1.5.2  hd8ed1ab_1              conda-forge/noarch        Cached
  + cached_property                 1.5.2  pyha770c72_1            conda-forge/noarch        Cached
  + cachetools                      4.2.4  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + certifi                     2021.5.30  py39hf3d152e_0          conda-forge/linux-64      Cached
  + cffi                           1.14.6  py39h4bc2ebd_1          conda-forge/linux-64      Cached
  + chardet                         4.0.0  py39hf3d152e_1          conda-forge/linux-64      Cached
  + charset-normalizer              2.0.0  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + click                           8.0.1  py39hf3d152e_0          conda-forge/linux-64      Cached
  + cryptography                    3.4.7  py39hbca0aa6_0          conda-forge/linux-64      Cached
  + dataclasses                       0.8  pyhc8e2a94_3            conda-forge/noarch        Cached
  + gast                            0.4.0  pyh9f0ad1d_0            conda-forge/noarch        Cached
  + giflib                          5.2.1  h36c2ea0_2              conda-forge/linux-64      Cached
  + google-auth                    1.35.0  pyh6c4a22f_0            conda-forge/noarch        Cached
  + google-auth-oauthlib            0.4.6  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + google-pasta                    0.2.0  pyh8c360ce_0            conda-forge/noarch        Cached
  + grpc-cpp                       1.37.1  hfc4d69e_3              conda-forge/linux-64      Cached
  + grpcio                         1.37.1  py39hff7568b_0          conda-forge/linux-64        2 MB
  + h5py                            3.1.0  nompi_py39h25020de_100  conda-forge/linux-64        1 MB
  + hdf5                           1.10.6  nompi_h6a2412b_1114     conda-forge/linux-64      Cached
  + icu                              68.1  h58526e2_0              conda-forge/linux-64      Cached
  + idna                              3.1  pyhd3deb0d_0            conda-forge/noarch        Cached
  + importlib-metadata              4.8.1  py39hf3d152e_0          conda-forge/linux-64      Cached
  + jpeg                               9d  h36c2ea0_0              conda-forge/linux-64      Cached
  + keras                           2.6.0  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + keras-preprocessing             1.1.2  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + krb5                           1.19.2  hcc1bbae_2              conda-forge/linux-64      Cached
  + ld_impl_linux-64               2.36.1  hea4e1c9_2              conda-forge/linux-64      Cached
  + libblas                         3.9.0  11_linux64_openblas     conda-forge/linux-64      Cached
  + libcblas                        3.9.0  11_linux64_openblas     conda-forge/linux-64      Cached
  + libcurl                        7.79.1  h2574ce0_1              conda-forge/linux-64      Cached
  + libedit                  3.1.20191231  he28a2e2_2              conda-forge/linux-64      Cached
  + libev                            4.33  h516909a_1              conda-forge/linux-64      Cached
  + libffi                          3.4.2  h9c3ff4c_4              conda-forge/linux-64      Cached
  + libgcc-ng                      11.2.0  h1d223b6_9              conda-forge/linux-64      Cached
  + libgfortran-ng                 11.2.0  h69a702a_9              conda-forge/linux-64      Cached
  + libgfortran5                   11.2.0  h5c6108e_9              conda-forge/linux-64      Cached
  + libgomp                        11.2.0  h1d223b6_9              conda-forge/linux-64      Cached
  + liblapack                       3.9.0  11_linux64_openblas     conda-forge/linux-64      Cached
  + libnghttp2                     1.43.0  h812cca2_1              conda-forge/linux-64      Cached
  + libopenblas                    0.3.17  pthreads_h8fe5266_1     conda-forge/linux-64      Cached
  + libpng                         1.6.37  h21135ba_2              conda-forge/linux-64      Cached
  + libprotobuf                    3.15.8  h780b84a_1              conda-forge/linux-64      Cached
  + libssh2                        1.10.0  ha56f1ee_2              conda-forge/linux-64      Cached
  + libstdcxx-ng                   11.2.0  he4da1e4_9              conda-forge/linux-64      Cached
  + libzlib                        1.2.11  h36c2ea0_1013           conda-forge/linux-64      Cached
  + markdown                        3.3.4  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + multidict                       5.2.0  py39h3811e60_0          conda-forge/linux-64       64 KB
  + ncurses                           6.2  h58526e2_4              conda-forge/linux-64      Cached
  + numpy                          1.19.5  py39hdbf815f_2          conda-forge/linux-64      Cached
  + oauthlib                        3.1.1  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + openssl                        1.1.1l  h7f98852_0              conda-forge/linux-64      Cached
  + opt_einsum                      3.3.0  pyhd8ed1ab_1            conda-forge/noarch        Cached
  + pip                            21.2.4  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + protobuf                       3.15.8  py39he80948d_0          conda-forge/linux-64      336 KB
  + pyasn1                          0.4.8  py_0                    conda-forge/noarch        Cached
  + pyasn1-modules                  0.2.7  py_0                    conda-forge/noarch        Cached
  + pycparser                        2.20  pyh9f0ad1d_2            conda-forge/noarch        Cached
  + pyjwt                           2.1.0  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + pyopenssl                      21.0.0  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + pysocks                         1.7.1  py39hf3d152e_3          conda-forge/linux-64      Cached
  + python                          3.9.7  hb7a2778_3_cpython      conda-forge/linux-64      Cached
  + python-flatbuffers               1.12  pyhd8ed1ab_1            conda-forge/noarch        Cached
  + python_abi                        3.9  2_cp39                  conda-forge/linux-64      Cached
  + pyu2f                           0.1.5  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + re2                        2021.08.01  h9c3ff4c_0              conda-forge/linux-64      Cached
  + readline                          8.1  h46c0cb4_0              conda-forge/linux-64      Cached
  + requests                       2.26.0  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + requests-oauthlib               1.3.0  pyh9f0ad1d_0            conda-forge/noarch        Cached
  + rsa                             4.7.2  pyh44b312d_0            conda-forge/noarch        Cached
  + scipy                           1.7.1  py39hee8e79c_0          conda-forge/linux-64       22 MB
  + setuptools                     58.2.0  py39hf3d152e_0          conda-forge/linux-64     1011 KB
  + six                            1.15.0  pyh9f0ad1d_0            conda-forge/noarch        Cached
  + snappy                          1.1.8  he1b5a44_3              conda-forge/linux-64      Cached
  + sqlite                         3.36.0  h9cd32fc_2              conda-forge/linux-64      Cached
  + tensorboard                     2.6.0  pyhd8ed1ab_1            conda-forge/noarch        Cached
  + tensorboard-data-server         0.6.0  py39h95dcef6_0          conda-forge/linux-64        3 MB
  + tensorboard-plugin-wit          1.8.0  pyh44b312d_0            conda-forge/noarch        Cached
  + tensorflow                      2.6.0  py39hf3d152e_0          conda-forge/linux-64       23 KB
  + tensorflow-base                 2.6.0  py39h23a8cbf_0          conda-forge/linux-64      111 MB
  + tensorflow-estimator            2.6.0  py39he80948d_0          conda-forge/linux-64      647 KB
  + termcolor                       1.1.0  py_2                    conda-forge/noarch        Cached
  + tk                             8.6.11  h27826a3_1              conda-forge/linux-64      Cached
  + typing-extensions             3.7.4.3  0                       conda-forge/noarch        Cached
  + typing_extensions             3.7.4.3  py_0                    conda-forge/noarch        Cached
  + tzdata                          2021c  he74cb21_0              conda-forge/noarch        120 KB
  + urllib3                        1.26.7  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + werkzeug                        2.0.1  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + wheel                          0.37.0  pyhd8ed1ab_1            conda-forge/noarch        Cached
  + wrapt                          1.12.1  py39h3811e60_3          conda-forge/linux-64      Cached
  + xz                              5.2.5  h516909a_1              conda-forge/linux-64      Cached
  + yarl                            1.6.3  py39h3811e60_2          conda-forge/linux-64      142 KB
  + zipp                            3.6.0  pyhd8ed1ab_0            conda-forge/noarch        Cached
  + zlib                           1.2.11  h36c2ea0_1013           conda-forge/linux-64      Cached

  Summary:

  Install: 106 packages

  Total download: 143 MB

─────────────────────────────────────────────────────────────────────────────────────────────────────

Confirm changes: [Y/n] 
Finished multidict                            (00m:00s)              64 KB    196 KB/s
Finished tzdata                               (00m:00s)             120 KB    339 KB/s
Finished protobuf                             (00m:00s)             336 KB    818 KB/s
Finished aiohttp                              (00m:00s)             624 KB      1 MB/s
Finished setuptools                           (00m:00s)            1011 KB      2 MB/s
Finished tensorflow                           (00m:00s)              23 KB     33 KB/s
Finished h5py                                 (00m:00s)               1 MB      2 MB/s
Finished tensorflow-estimator                 (00m:00s)             647 KB    649 KB/s
Finished yarl                                 (00m:00s)             142 KB    130 KB/s
Finished grpcio                               (00m:00s)               2 MB      2 MB/s
Finished tensorboard-data-server              (00m:00s)               3 MB      3 MB/s
Finished scipy                                (00m:04s)              22 MB      4 MB/s
Finished tensorflow-base                      (00m:12s)             111 MB      8 MB/s
Downloading  [====================================================================================================] (00m:44s)   10.69 MB/s
Extracting   [====================================================================================================] (00m:44s)      13 / 13
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate tf26
#
# To deactivate an active environment, use
#
#     $ conda deactivate

$ conda activate tf26
(tf26) $ python
Python 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:20:46) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> mnist = tf.keras.datasets.mnist
>>> 
>>> (x_train, y_train),(x_test, y_test) = mnist.load_data()
>>> x_train, x_test = x_train / 255.0, x_test / 255.0
>>> 
>>> model = tf.keras.models.Sequential([
...   tf.keras.layers.Flatten(input_shape=(28, 28)),
...   tf.keras.layers.Dense(128, activation='relu'),
...   tf.keras.layers.Dropout(0.2),
...   tf.keras.layers.Dense(10, activation='softmax')
... ])
2021-10-07 17:38:43.411655: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/training/tracking/base.py", line 530, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/keras/engine/sequential.py", line 107, in __init__
    super(functional.Functional, self).__init__(  # pylint: disable=bad-super-call
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/training/tracking/base.py", line 530, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/keras/engine/training.py", line 289, in __init__
    self._init_batch_counters()
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/training/tracking/base.py", line 530, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/keras/engine/training.py", line 297, in _init_batch_counters
    self._train_counter = tf.Variable(0, dtype='int64', aggregation=agg)
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/ops/variables.py", line 268, in __call__
    return cls._variable_v2_call(*args, **kwargs)
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/ops/variables.py", line 250, in _variable_v2_call
    return previous_getter(
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/ops/variables.py", line 243, in <lambda>
    previous_getter = lambda **kws: default_variable_creator_v2(None, **kws)
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/ops/variable_scope.py", line 2662, in default_variable_creator_v2
    return resource_variable_ops.ResourceVariable(
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/ops/variables.py", line 270, in __call__
    return super(VariableMetaclass, cls).__call__(*args, **kwargs)
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 1602, in __init__
    self._init_from_args(
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 1756, in _init_from_args
    handle = eager_safe_variable_handle(
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 238, in eager_safe_variable_handle
    return _variable_handle_from_shape_and_dtype(shape, dtype, shared_name, name,
  File "~/miniconda/envs/tf26/lib/python3.9/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 178, in _variable_handle_from_shape_and_dtype
    cpp_shape_inference_pb2.CppShapeInferenceResult.HandleShapeAndType(
TypeError: Parameter to MergeFrom() must be instance of same class: expected tensorflow.TensorShapeProto got tensorflow.TensorShapeProto.
conda info

     active environment : tf26
    active env location : ~/miniconda/envs/tf26
            shell level : 2
       user config file : ~/.condarc
 populated config files : ~/miniconda/.condarc
                          ~/.condarc
          conda version : 4.10.3
    conda-build version : 3.21.4
         python version : 3.9.7.final.0
       virtual packages : __linux=5.13.19=0
                          __glibc=2.33=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : ~/miniconda  (writable)
      conda av data dir : ~/miniconda/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : ~/miniconda/pkgs
                          ~/.conda/pkgs
       envs directories : ~/miniconda/envs
                          ~/.conda/envs
               platform : linux-64
             user-agent : conda/4.10.3 requests/2.26.0 CPython/3.9.7 Linux/5.13.19-200.fc34.x86_64 fedora/34 glibc/2.33
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False
183amir commented 3 years ago

It's also broken in conda-forge's docker image:

sudo docker run --rm -it quay.io/condaforge/linux-anvil-comp7
[conda@339fecdfe740 ~]$ cd
[conda@339fecdfe740 ~]$ pwd
/home/conda
[conda@339fecdfe740 ~]$ conda create -n tf26 python=3.8 tensorflow
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /opt/conda/envs/tf26

  added / updated specs:
    - python=3.8
    - tensorflow

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    abseil-cpp-20210324.2      |       h9c3ff4c_0        1010 KB  conda-forge
    absl-py-0.14.1             |     pyhd8ed1ab_0          98 KB  conda-forge
    aiohttp-3.7.4.post0        |   py38h497a2fe_0         641 KB  conda-forge
    astor-0.8.1                |     pyh9f0ad1d_0          25 KB  conda-forge
    astunparse-1.6.3           |     pyhd8ed1ab_0          15 KB  conda-forge
    async-timeout-3.0.1        |          py_1000          11 KB  conda-forge
    blinker-1.4                |             py_1          13 KB  conda-forge
    cached-property-1.5.2      |       hd8ed1ab_1           4 KB  conda-forge
    cached_property-1.5.2      |     pyha770c72_1          11 KB  conda-forge
    cachetools-4.2.4           |     pyhd8ed1ab_0          12 KB  conda-forge
    click-8.0.1                |   py38h578d9bd_0         146 KB  conda-forge
    dataclasses-0.8            |     pyhc8e2a94_3          10 KB  conda-forge
    gast-0.4.0                 |     pyh9f0ad1d_0          12 KB  conda-forge
    giflib-5.2.1               |       h36c2ea0_2          77 KB  conda-forge
    google-auth-1.35.0         |     pyh6c4a22f_0          81 KB  conda-forge
    google-auth-oauthlib-0.4.6 |     pyhd8ed1ab_0          19 KB  conda-forge
    google-pasta-0.2.0         |     pyh8c360ce_0          42 KB  conda-forge
    grpc-cpp-1.37.1            |       hfc4d69e_3         3.5 MB  conda-forge
    grpcio-1.37.1              |   py38hdd6454d_0         2.2 MB  conda-forge
    h5py-3.1.0                 |nompi_py38hafa665b_100         1.2 MB  conda-forge
    hdf5-1.10.6                |nompi_h6a2412b_1114         3.1 MB  conda-forge
    jpeg-9d                    |       h36c2ea0_0         264 KB  conda-forge
    keras-2.6.0                |     pyhd8ed1ab_0         822 KB  conda-forge
    keras-preprocessing-1.1.2  |     pyhd8ed1ab_0          34 KB  conda-forge
    krb5-1.19.2                |       hcc1bbae_2         1.4 MB  conda-forge
    libblas-3.9.0              |11_linux64_openblas          12 KB  conda-forge
    libcblas-3.9.0             |11_linux64_openblas          11 KB  conda-forge
    libcurl-7.79.1             |       h2574ce0_1         335 KB  conda-forge
    libffi-3.4.2               |       h9c3ff4c_4          57 KB  conda-forge
    libgcc-ng-11.2.0           |       h1d223b6_9         889 KB  conda-forge
    libgfortran-ng-11.2.0      |       h69a702a_9          19 KB  conda-forge
    libgfortran5-11.2.0        |       h5c6108e_9         1.7 MB  conda-forge
    libgomp-11.2.0             |       h1d223b6_9         428 KB  conda-forge
    liblapack-3.9.0            |11_linux64_openblas          11 KB  conda-forge
    libnghttp2-1.43.0          |       h812cca2_1         790 KB  conda-forge
    libopenblas-0.3.17         |pthreads_h8fe5266_1         9.2 MB  conda-forge
    libpng-1.6.37              |       h21135ba_2         306 KB  conda-forge
    libprotobuf-3.15.8         |       h780b84a_1         2.5 MB  conda-forge
    libssh2-1.10.0             |       ha56f1ee_2         233 KB  conda-forge
    libstdcxx-ng-11.2.0        |       he4da1e4_9         4.2 MB  conda-forge
    libzlib-1.2.11             |    h36c2ea0_1013          59 KB  conda-forge
    markdown-3.3.4             |     pyhd8ed1ab_0          67 KB  conda-forge
    multidict-5.2.0            |   py38h497a2fe_0          64 KB  conda-forge
    numpy-1.19.5               |   py38h9894fe3_2         5.3 MB  conda-forge
    oauthlib-3.1.1             |     pyhd8ed1ab_0          87 KB  conda-forge
    opt_einsum-3.3.0           |     pyhd8ed1ab_1          53 KB  conda-forge
    protobuf-3.15.8            |   py38h709712a_0         341 KB  conda-forge
    pyasn1-0.4.8               |             py_0          53 KB  conda-forge
    pyasn1-modules-0.2.7       |             py_0          60 KB  conda-forge
    pyjwt-2.1.0                |     pyhd8ed1ab_0          17 KB  conda-forge
    pyopenssl-21.0.0           |     pyhd8ed1ab_0          48 KB  conda-forge
    python-3.8.12              |hb7a2778_1_cpython        26.2 MB  conda-forge
    python-flatbuffers-1.12    |     pyhd8ed1ab_1          19 KB  conda-forge
    python_abi-3.8             |           2_cp38           4 KB  conda-forge
    pyu2f-0.1.5                |     pyhd8ed1ab_0          31 KB  conda-forge
    re2-2021.08.01             |       h9c3ff4c_0         220 KB  conda-forge
    requests-oauthlib-1.3.0    |     pyh9f0ad1d_0          21 KB  conda-forge
    rsa-4.7.2                  |     pyh44b312d_0          28 KB  conda-forge
    scipy-1.7.1                |   py38h56a6a73_0        21.9 MB  conda-forge
    setuptools-58.2.0          |   py38h578d9bd_0         1.0 MB  conda-forge
    six-1.15.0                 |     pyh9f0ad1d_0          14 KB  conda-forge
    snappy-1.1.8               |       he1b5a44_3          32 KB  conda-forge
    sqlite-3.36.0              |       h9cd32fc_2         1.4 MB  conda-forge
    tensorboard-2.6.0          |     pyhd8ed1ab_1         5.0 MB  conda-forge
    tensorboard-data-server-0.6.0|   py38h3e25421_0         3.3 MB  conda-forge
    tensorboard-plugin-wit-1.8.0|     pyh44b312d_0         670 KB  conda-forge
    tensorflow-2.6.0           |   py38h578d9bd_0          23 KB  conda-forge
    tensorflow-base-2.6.0      |   py38h83f5f1d_0       111.0 MB  conda-forge
    tensorflow-estimator-2.6.0 |   py38h709712a_0         651 KB  conda-forge
    termcolor-1.1.0            |             py_2           6 KB  conda-forge
    typing-extensions-3.7.4.3  |                0           8 KB  conda-forge
    typing_extensions-3.7.4.3  |             py_0          25 KB  conda-forge
    urllib3-1.26.7             |     pyhd8ed1ab_0         100 KB  conda-forge
    werkzeug-2.0.1             |     pyhd8ed1ab_0         219 KB  conda-forge
    wrapt-1.12.1               |   py38h497a2fe_3          47 KB  conda-forge
    yarl-1.6.3                 |   py38h497a2fe_2         143 KB  conda-forge
    zipp-3.6.0                 |     pyhd8ed1ab_0          12 KB  conda-forge
    zlib-1.2.11                |    h36c2ea0_1013          86 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       213.6 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge
  _openmp_mutex      conda-forge/linux-64::_openmp_mutex-4.5-1_gnu
  abseil-cpp         conda-forge/linux-64::abseil-cpp-20210324.2-h9c3ff4c_0
  absl-py            conda-forge/noarch::absl-py-0.14.1-pyhd8ed1ab_0
  aiohttp            conda-forge/linux-64::aiohttp-3.7.4.post0-py38h497a2fe_0
  astor              conda-forge/noarch::astor-0.8.1-pyh9f0ad1d_0
  astunparse         conda-forge/noarch::astunparse-1.6.3-pyhd8ed1ab_0
  async-timeout      conda-forge/noarch::async-timeout-3.0.1-py_1000
  attrs              conda-forge/noarch::attrs-21.2.0-pyhd8ed1ab_0
  blinker            conda-forge/noarch::blinker-1.4-py_1
  brotlipy           conda-forge/linux-64::brotlipy-0.7.0-py38h497a2fe_1001
  c-ares             conda-forge/linux-64::c-ares-1.17.2-h7f98852_0
  ca-certificates    conda-forge/linux-64::ca-certificates-2021.5.30-ha878542_0
  cached-property    conda-forge/noarch::cached-property-1.5.2-hd8ed1ab_1
  cached_property    conda-forge/noarch::cached_property-1.5.2-pyha770c72_1
  cachetools         conda-forge/noarch::cachetools-4.2.4-pyhd8ed1ab_0
  certifi            conda-forge/linux-64::certifi-2021.5.30-py38h578d9bd_0
  cffi               conda-forge/linux-64::cffi-1.14.6-py38h3931269_1
  chardet            conda-forge/linux-64::chardet-4.0.0-py38h578d9bd_1
  charset-normalizer conda-forge/noarch::charset-normalizer-2.0.0-pyhd8ed1ab_0
  click              conda-forge/linux-64::click-8.0.1-py38h578d9bd_0
  cryptography       conda-forge/linux-64::cryptography-3.4.7-py38ha5dfef3_0
  dataclasses        conda-forge/noarch::dataclasses-0.8-pyhc8e2a94_3
  gast               conda-forge/noarch::gast-0.4.0-pyh9f0ad1d_0
  giflib             conda-forge/linux-64::giflib-5.2.1-h36c2ea0_2
  google-auth        conda-forge/noarch::google-auth-1.35.0-pyh6c4a22f_0
  google-auth-oauth~ conda-forge/noarch::google-auth-oauthlib-0.4.6-pyhd8ed1ab_0
  google-pasta       conda-forge/noarch::google-pasta-0.2.0-pyh8c360ce_0
  grpc-cpp           conda-forge/linux-64::grpc-cpp-1.37.1-hfc4d69e_3
  grpcio             conda-forge/linux-64::grpcio-1.37.1-py38hdd6454d_0
  h5py               conda-forge/linux-64::h5py-3.1.0-nompi_py38hafa665b_100
  hdf5               conda-forge/linux-64::hdf5-1.10.6-nompi_h6a2412b_1114
  icu                conda-forge/linux-64::icu-68.1-h58526e2_0
  idna               conda-forge/noarch::idna-3.1-pyhd3deb0d_0
  importlib-metadata conda-forge/linux-64::importlib-metadata-4.8.1-py38h578d9bd_0
  jpeg               conda-forge/linux-64::jpeg-9d-h36c2ea0_0
  keras              conda-forge/noarch::keras-2.6.0-pyhd8ed1ab_0
  keras-preprocessi~ conda-forge/noarch::keras-preprocessing-1.1.2-pyhd8ed1ab_0
  krb5               conda-forge/linux-64::krb5-1.19.2-hcc1bbae_2
  ld_impl_linux-64   conda-forge/linux-64::ld_impl_linux-64-2.36.1-hea4e1c9_2
  libblas            conda-forge/linux-64::libblas-3.9.0-11_linux64_openblas
  libcblas           conda-forge/linux-64::libcblas-3.9.0-11_linux64_openblas
  libcurl            conda-forge/linux-64::libcurl-7.79.1-h2574ce0_1
  libedit            conda-forge/linux-64::libedit-3.1.20191231-he28a2e2_2
  libev              conda-forge/linux-64::libev-4.33-h516909a_1
  libffi             conda-forge/linux-64::libffi-3.4.2-h9c3ff4c_4
  libgcc-ng          conda-forge/linux-64::libgcc-ng-11.2.0-h1d223b6_9
  libgfortran-ng     conda-forge/linux-64::libgfortran-ng-11.2.0-h69a702a_9
  libgfortran5       conda-forge/linux-64::libgfortran5-11.2.0-h5c6108e_9
  libgomp            conda-forge/linux-64::libgomp-11.2.0-h1d223b6_9
  liblapack          conda-forge/linux-64::liblapack-3.9.0-11_linux64_openblas
  libnghttp2         conda-forge/linux-64::libnghttp2-1.43.0-h812cca2_1
  libopenblas        conda-forge/linux-64::libopenblas-0.3.17-pthreads_h8fe5266_1
  libpng             conda-forge/linux-64::libpng-1.6.37-h21135ba_2
  libprotobuf        conda-forge/linux-64::libprotobuf-3.15.8-h780b84a_1
  libssh2            conda-forge/linux-64::libssh2-1.10.0-ha56f1ee_2
  libstdcxx-ng       conda-forge/linux-64::libstdcxx-ng-11.2.0-he4da1e4_9
  libzlib            conda-forge/linux-64::libzlib-1.2.11-h36c2ea0_1013
  markdown           conda-forge/noarch::markdown-3.3.4-pyhd8ed1ab_0
  multidict          conda-forge/linux-64::multidict-5.2.0-py38h497a2fe_0
  ncurses            conda-forge/linux-64::ncurses-6.2-h58526e2_4
  numpy              conda-forge/linux-64::numpy-1.19.5-py38h9894fe3_2
  oauthlib           conda-forge/noarch::oauthlib-3.1.1-pyhd8ed1ab_0
  openssl            conda-forge/linux-64::openssl-1.1.1l-h7f98852_0
  opt_einsum         conda-forge/noarch::opt_einsum-3.3.0-pyhd8ed1ab_1
  pip                conda-forge/noarch::pip-21.2.4-pyhd8ed1ab_0
  protobuf           conda-forge/linux-64::protobuf-3.15.8-py38h709712a_0
  pyasn1             conda-forge/noarch::pyasn1-0.4.8-py_0
  pyasn1-modules     conda-forge/noarch::pyasn1-modules-0.2.7-py_0
  pycparser          conda-forge/noarch::pycparser-2.20-pyh9f0ad1d_2
  pyjwt              conda-forge/noarch::pyjwt-2.1.0-pyhd8ed1ab_0
  pyopenssl          conda-forge/noarch::pyopenssl-21.0.0-pyhd8ed1ab_0
  pysocks            conda-forge/linux-64::pysocks-1.7.1-py38h578d9bd_3
  python             conda-forge/linux-64::python-3.8.12-hb7a2778_1_cpython
  python-flatbuffers conda-forge/noarch::python-flatbuffers-1.12-pyhd8ed1ab_1
  python_abi         conda-forge/linux-64::python_abi-3.8-2_cp38
  pyu2f              conda-forge/noarch::pyu2f-0.1.5-pyhd8ed1ab_0
  re2                conda-forge/linux-64::re2-2021.08.01-h9c3ff4c_0
  readline           conda-forge/linux-64::readline-8.1-h46c0cb4_0
  requests           conda-forge/noarch::requests-2.26.0-pyhd8ed1ab_0
  requests-oauthlib  conda-forge/noarch::requests-oauthlib-1.3.0-pyh9f0ad1d_0
  rsa                conda-forge/noarch::rsa-4.7.2-pyh44b312d_0
  scipy              conda-forge/linux-64::scipy-1.7.1-py38h56a6a73_0
  setuptools         conda-forge/linux-64::setuptools-58.2.0-py38h578d9bd_0
  six                conda-forge/noarch::six-1.15.0-pyh9f0ad1d_0
  snappy             conda-forge/linux-64::snappy-1.1.8-he1b5a44_3
  sqlite             conda-forge/linux-64::sqlite-3.36.0-h9cd32fc_2
  tensorboard        conda-forge/noarch::tensorboard-2.6.0-pyhd8ed1ab_1
  tensorboard-data-~ conda-forge/linux-64::tensorboard-data-server-0.6.0-py38h3e25421_0
  tensorboard-plugi~ conda-forge/noarch::tensorboard-plugin-wit-1.8.0-pyh44b312d_0
  tensorflow         conda-forge/linux-64::tensorflow-2.6.0-py38h578d9bd_0
  tensorflow-base    conda-forge/linux-64::tensorflow-base-2.6.0-py38h83f5f1d_0
  tensorflow-estima~ conda-forge/linux-64::tensorflow-estimator-2.6.0-py38h709712a_0
  termcolor          conda-forge/noarch::termcolor-1.1.0-py_2
  tk                 conda-forge/linux-64::tk-8.6.11-h27826a3_1
  typing-extensions  conda-forge/noarch::typing-extensions-3.7.4.3-0
  typing_extensions  conda-forge/noarch::typing_extensions-3.7.4.3-py_0
  urllib3            conda-forge/noarch::urllib3-1.26.7-pyhd8ed1ab_0
  werkzeug           conda-forge/noarch::werkzeug-2.0.1-pyhd8ed1ab_0
  wheel              conda-forge/noarch::wheel-0.37.0-pyhd8ed1ab_1
  wrapt              conda-forge/linux-64::wrapt-1.12.1-py38h497a2fe_3
  xz                 conda-forge/linux-64::xz-5.2.5-h516909a_1
  yarl               conda-forge/linux-64::yarl-1.6.3-py38h497a2fe_2
  zipp               conda-forge/noarch::zipp-3.6.0-pyhd8ed1ab_0
  zlib               conda-forge/linux-64::zlib-1.2.11-h36c2ea0_1013

Proceed ([y]/n)? y

Downloading and Extracting Packages
...
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate tf26
#
# To deactivate an active environment, use
#
#     $ conda deactivate

[conda@339fecdfe740 ~]$ conda activate tf26
(tf26) [conda@339fecdfe740 ~]$ python
Python 3.8.12 | packaged by conda-forge | (default, Sep 29 2021, 19:52:28) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> mnist = tf.keras.datasets.mnist
>>> 
>>> (x_train, y_train),(x_test, y_test) = mnist.load_data()
Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
11493376/11490434 [==============================] - 1s 0us/step
11501568/11490434 [==============================] - 1s 0us/step
>>> x_train, x_test = x_train / 255.0, x_test / 255.0
>>> 
>>> model = tf.keras.models.Sequential([
...   tf.keras.layers.Flatten(input_shape=(28, 28)),
...   tf.keras.layers.Dense(128, activation='relu'),
...   tf.keras.layers.Dropout(0.2),
...   tf.keras.layers.Dense(10, activation='softmax')
... ])
2021-10-07 16:08:39.079675: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/training/tracking/base.py", line 530, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/keras/engine/sequential.py", line 107, in __init__
    super(functional.Functional, self).__init__(  # pylint: disable=bad-super-call
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/training/tracking/base.py", line 530, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/keras/engine/training.py", line 289, in __init__
    self._init_batch_counters()
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/training/tracking/base.py", line 530, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/keras/engine/training.py", line 297, in _init_batch_counters
    self._train_counter = tf.Variable(0, dtype='int64', aggregation=agg)
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 268, in __call__
    return cls._variable_v2_call(*args, **kwargs)
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 250, in _variable_v2_call
    return previous_getter(
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 243, in <lambda>
    previous_getter = lambda **kws: default_variable_creator_v2(None, **kws)
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/variable_scope.py", line 2662, in default_variable_creator_v2
    return resource_variable_ops.ResourceVariable(
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/variables.py", line 270, in __call__
    return super(VariableMetaclass, cls).__call__(*args, **kwargs)
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 1602, in __init__
    self._init_from_args(
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 1756, in _init_from_args
    handle = eager_safe_variable_handle(
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 238, in eager_safe_variable_handle
    return _variable_handle_from_shape_and_dtype(shape, dtype, shared_name, name,
  File "/opt/conda/envs/tf26/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 178, in _variable_handle_from_shape_and_dtype
    cpp_shape_inference_pb2.CppShapeInferenceResult.HandleShapeAndType(
TypeError: Parameter to MergeFrom() must be instance of same class: expected tensorflow.TensorShapeProto got tensorflow.TensorShapeProto.
>>> 
izahn commented 3 years ago

confirmed, they are broken for me too.

wolfv commented 3 years ago

Could this be related to some protobuf version? I am seeing a post with the same issue here: https://deeptalk.lambdalabs.com/t/cant-build-keras-model-after-tensorflow-update-from-2-2-to-2-3/1799

hmaarrfk commented 2 years ago

I added the test specified above to the build process in https://github.com/conda-forge/tensorflow-feedstock/pull/142

Hopefully this solves things

``` import tensorflow as tf mnist = tf.keras.datasets.mnist (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train, x_test = x_train / 255.0, x_test / 255.0 model = tf.keras.models.Sequential([ tf.keras.layers.Flatten(input_shape=(28, 28)), tf.keras.layers.Dense(128, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(10, activation='softmax') ]) ```
hmaarrfk commented 2 years ago

Seems like a protobuf issue: https://deeptalk.lambdalabs.com/t/cant-build-keras-model-after-tensorflow-update-from-2-2-to-2-3/1799

But I can't tell where we are diverging.

hmaarrfk commented 2 years ago

I can confirm that the 2.4 packages work.

hmaarrfk commented 2 years ago

Oddly. this patch fixes things: https://github.com/tensorflow/tensorflow/pull/51450/files

Described in Gentoo https://bugs.gentoo.org/806541

hmaarrfk commented 2 years ago

For those that need the fix today, ^^^ I tested this by just modifying the aforementioned __init__.py file

hmaarrfk commented 2 years ago

image

hmaarrfk commented 2 years ago

The builds should soon be finished!