datasets icon indicating copy to clipboard operation
datasets copied to clipboard

Exception ignored in: <function AtomicFunction.__del__ at 0x71926a728940>

Open Nugine opened this issue 1 year ago • 19 comments

/!\ PLEASE INCLUDE THE FULL STACKTRACE AND CODE SNIPPET

Short description Description of the bug.

Environment information

  • Operating System: Ubuntu 22.04

  • Python version: 3.10.12

  • tensorflow-datasets/tfds-nightly version: tfds-nightly 4.9.4.dev202404060044

  • tensorflow/tf-nightly version: tensorflow 2.16.1

  • Does the issue still exists with the last tfds-nightly package (pip install --upgrade tfds-nightly) ? Yes.

Reproduction instructions

import tensorflow_datasets as tfds

examples, metadata = tfds.load("ted_hrlr_translate/pt_to_en", with_info=True, as_supervised=True)
python3 a.py
Exception ignored in: <function AtomicFunction.__del__ at 0x71926a728940>
Traceback (most recent call last):
  File "/home/nugine/.local/lib/python3.10/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x71926a728940>
Traceback (most recent call last):
  File "/home/nugine/.local/lib/python3.10/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x71926a728940>
Traceback (most recent call last):
  File "/home/nugine/.local/lib/python3.10/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x71926a728940>
Traceback (most recent call last):
  File "/home/nugine/.local/lib/python3.10/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x71926a728940>
Traceback (most recent call last):
  File "/home/nugine/.local/lib/python3.10/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x71926a728940>
Traceback (most recent call last):
  File "/home/nugine/.local/lib/python3.10/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x71926a728940>
Traceback (most recent call last):
  File "/home/nugine/.local/lib/python3.10/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x71926a728940>
Traceback (most recent call last):
  File "/home/nugine/.local/lib/python3.10/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x71926a728940>
Traceback (most recent call last):
  File "/home/nugine/.local/lib/python3.10/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable

If you share a colab, make sure to update the permissions to share it.

Link to logs If applicable, <link to gist with logs, stack trace>

Expected behavior What you expected to happen.

Additional context Add any other context about the problem here.

Nugine avatar Apr 06 '24 15:04 Nugine

@Nugine I don't reproduce the issue on https://colab.sandbox.google.com.

Can you maybe try with tensorflow==2.15? We should adapt to the latest version of tf though.

marcenacp avatar Apr 11 '24 09:04 marcenacp

I can reproduce in colab. https://colab.research.google.com/drive/1OmXca6IkoirknPNyDGlxoG6U8w105SpE?usp=sharing

Nugine avatar Apr 11 '24 10:04 Nugine

I also encountered the same problem, is there any progress?

wen020 avatar Apr 12 '24 14:04 wen020

I can reproduce in colab. https://colab.research.google.com/drive/1OmXca6IkoirknPNyDGlxoG6U8w105SpE?usp=sharing

In this colab, you pip install tfds-nightly (tensorflow==2.16), can you instead use tensorflow==2.15? We're working on making TFDS fully compatible with the last version of TF.

Thanks!

marcenacp avatar Apr 17 '24 07:04 marcenacp

tensorflow==2.15 has the same issue.

2024-04-17 07:45:47.987249: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-04-17 07:45:47.987331: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-04-17 07:45:47.989799: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-04-17 07:45:48.004805: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-04-17 07:45:49.531209: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
tf 2.15.0
tfds 4.9.4+nightly
Exception ignored in: <function AtomicFunction.__del__ at 0x7965e32c6e60>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x7965e32c6e60>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x7965e32c6e60>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x7965e32c6e60>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x7965e32c6e60>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x7965e32c6e60>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x7965e32c6e60>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x7965e32c6e60>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x7965e32c6e60>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable

Nugine avatar Apr 17 '24 07:04 Nugine

@Nugine, can you share the full notebook? It works on https://colab.research.google.com/drive/1ZYxKQRONh259y6BzxfvVjlLHl-PK7S2B

marcenacp avatar Apr 17 '24 11:04 marcenacp

@Nugine, can you share the full notebook? It works on https://colab.research.google.com/drive/1ZYxKQRONh259y6BzxfvVjlLHl-PK7S2B

The error occurs when python process exits. You won't see it in jupyter environment.

https://colab.research.google.com/drive/1OmXca6IkoirknPNyDGlxoG6U8w105SpE?usp=sharing

2024-04-17_19-56-31

Nugine avatar Apr 17 '24 11:04 Nugine

Is there any progress in getting a solution? I have the same problem

javierjuan avatar May 05 '24 21:05 javierjuan

same problem for me! It seems the corrupt happened in tensorflow.python package, although I avoid using it as much as I can!

congcongke avatar May 13 '24 06:05 congcongke

I just re-opened the bug with the tensorflow team. The exception seems to be caught too late in the code. Let's see what they say, thanks for your patience!

marcenacp avatar May 13 '24 11:05 marcenacp

Same problem for me. Please keep us updated :)

LouisMareschal avatar May 14 '24 12:05 LouisMareschal

Same issue

WesleyHsieh0806 avatar May 15 '24 19:05 WesleyHsieh0806

same issue

abdalhafid avatar May 21 '24 10:05 abdalhafid

+1

chengcongdu avatar May 30 '24 03:05 chengcongdu

Following the same issue

ChaosAdmStudent avatar May 31 '24 05:05 ChaosAdmStudent

Update: the TensorFlow team is actively working on this issue. Thanks for your patience!

marcenacp avatar May 31 '24 07:05 marcenacp

Exception ignored in: <function AtomicFunction.del at 0x791a7d1a9c60> Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in del TypeError: 'NoneType' object is not subscriptable Exception ignored in: <function AtomicFunction.del at 0x791a7d1a9c60> Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in del TypeError: 'NoneType' object is not subscriptable can someone help

Antoniodevy avatar Jun 05 '24 12:06 Antoniodevy

Problem still exists

Exception ignored in: <function AtomicFunction.__del__ at 0x7c7daba2ef20>
Traceback (most recent call last):
.../lib/python3.11/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable
Exception ignored in: <function AtomicFunction.__del__ at 0x7c7daba2ef20>
Traceback (most recent call last):
.../lib/python3.11/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py", line 291, in __del__
TypeError: 'NoneType' object is not subscriptable

Process finished with exit code 0

livanosg avatar Jun 14 '24 09:06 livanosg

Any update? I also meet this problem.

Haiyang-W avatar Jun 23 '24 16:06 Haiyang-W

The issue is fixed in the newest versions:

!pip install -U tensorflow=="2.17.0rc1" tfds-nightly

Thanks everyone for your patience!

marcenacp avatar Jul 10 '24 11:07 marcenacp

The issue is fixed in the newest versions:

!pip install -U tensorflow=="2.17.0rc1" tfds-nightly

Thanks everyone for your patience!

After I use this newest version, stopping here when I try training something... this code work in 2.16.0 version...:

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  y["variety"] = encoder.fit_transform(y["variety"])
/opt/homebrew/Caskroom/miniconda/base/envs/deep-learning/lib/python3.11/site-packages/keras/src/layers/core/dense.py:87: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
Epoch 1/32

Lucien1999s avatar Jul 11 '24 07:07 Lucien1999s

After trying it, I found that as long as you don't specify the python environment of conda, and then use conda install tensorflow and tensorflow_datasets, it can run normally.

Lucien1999s avatar Jul 14 '24 08:07 Lucien1999s

Any way of solving it but keeping TF 2.15.* ?

alvaro-stylesage avatar Jul 18 '24 12:07 alvaro-stylesage

Any way of solving it but keeping TF 2.15.* ?

+1 on this question! :)

Orient-Dorey avatar Sep 09 '24 13:09 Orient-Dorey