pythontensorflowvisual-studio-codetflearn

VS code Tensorflow error: disable_resource_variables


i was trying to make a simple chatbot in Python. But when I try to run my script, I get this error.

WARNING:tensorflow:From C:\Python311\Lib\site-packages\tensorflow\python\compat\v2_compat.py:107: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
    from .recurrent import lstm, gru, simple_rnn, bidirectional_rnn, \
    from .recurrent import lstm, gru, simple_rnn, bidirectional_rnn, \
  File "C:\Python311\Lib\site-packages\tflearn\layers\recurrent.py", line 17, in <module>
    from tensorflow.python.util.nest import is_sequence
ImportError: cannot import name 'is_sequence' from 'tensorflow.python.util.nest' (C:\Python311\Lib\site-packages\tensorflow\python\util\nest.py)
python version is 3.11.3
Tensorflow version 2.13

Any idea what's the issue?


Solution

  • This is related to tflearn. Here's the Github link about Replaces is_sequence() with is_sequence_or_composite().

    For me, I am currently using tensorflow 2.12.0, which can run correctly. You can try to downgrade TensorFlow.