Error message
Exception ignored in: <bound method BaseSession.__del__ of <tensorflow.python.client.session.Session object at 0x000000001AB286D8>>
Traceback (most recent call last):
File "python3.5.2\lib\site-packages\tensorflow\python\client\session.py", line xxx, in __del__
TypeError: 'NoneType' object is not callable
Reason: When the Python garbage collection mechanism collects the Session object, it finds that c_api_util or Tf_session has been collected, resulting in a null pointer. The following comment is the reason given when an exception is thrown in the source code of TensorFlow
# At shutdown, `c_api_util` or `tf_session` may have been garbage
# collected, causing the above method calls to fail. In this case,
# silently leak since the program is about to terminate anyway.
The solution
Method one:
import keras.backend as K
# your code
K.clear_session()
Method 2:
import gc
# your code
gc.collect()
reference
https://github.com/tensorflow/tensorflow/issues/3388
https://www.cnblogs.com/kaituorensheng/p/4449457.html
Read More:
- Processing method of PIP exception no module named ‘pip’
- Method threw ‘java.lang.NullPointerException‘ exception. Cannot evaluate com.sun.proxy.xxx
- [Jackson exception] com.fasterxml.jackson . databind.JsonMappingException Exception handling method
- Spring boot JPA Repository exception Validation failed for query for method
- [Solved] nested exception is com.alibaba.dubbo.rpc.RpcException: Failed t o invoke the method findPage
- Difference between isempty method and isblank method in stringutils
- Invalid bound statement (not found) of custom SQL in mybatisplus
- The solution of a Java exception has occurred. And error exception in thread when eclipse runs
- Realize the simplest recursive call, simulate exception in thread “main” java.lang.stackoverflowerror exception
- The differences between the equals method in the string class and the equals method in the object class
- Solve the problem that power view in Excel prompts activate method of oleobject class failed or activate method like oleobject is invalid
- Solved: elasticsearch error: exception [type = search]_ phase_ execution_ exception, reason=all shards failed]
- Ora-01008: not all variables are bound
- Tensorflow in function tf.Print Method of outputting intermediate value
- “Method does not override method from its superclass”
- Namespace ‘app’ is not bound
- Handling nullreference exception problems encountered in NHibernate
- Spring boot can’t scan XML (invalid bound statement (not found))
- How to Fix Invalid bound statement (not found) Error
- The method of getting shell command output in Python