Hi,
In my JetPack 3.2 / python 3.6.3 environment, tensroflow multi-session problem occurred by apt-get dist-upgrade.
I downgraded packages and solved it.
Downgrade:
apt-get install python3-update-manager=1:16.04.3 update-manager=1:16.04.3 update-manager-core=1:16.04.3 update-notifier-common=3.168
Only for my python3.6.3:(because add-apt-repository doesn’t work with python 3.6)
head -n1 /usr/bin/add-apt-repository
sed -i 's/^#! \/usr\/bin\/python3$/#! \/usr\/bin\/python3\.5/g' /usr/bin/add-apt-repository
head -n1 /usr/bin/add-apt-repository
I found installable package versions with the following command.
apt-cache policy python3-update-manager update-manager update-manager-core update-notifier-common
My error log:
ubuntu@tegra-ubuntu:~/notebooks/github/realtime_object_detection$ python object_detection.py
Model found. Proceed.
Loading frozen model into memory
2018-06-08 10:36:18.409650: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:865] ARM64 does not support NUMA - returning NUMA node zero
2018-06-08 10:36:18.409813: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1212] Found device 0 with properties:
name: NVIDIA Tegra X2 major: 6 minor: 2 memoryClockRate(GHz): 1.3005
pciBusID: 0000:00:00.0
totalMemory: 7.66GiB freeMemory: 5.93GiB
2018-06-08 10:36:18.409865: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2018-06-08 10:36:21.072831: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 5050 MB memory) -> physical GPU (device: 0, name: NVIDIA Tegra X2, pci bus id: 0000:00:00.0, compute capability: 6.2)
Loading label map
Building Graph
2018-06-08 10:36:59.790357: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2018-06-08 10:36:59.790501: E tensorflow/core/common_runtime/direct_session.cc:167] Internal: CUDA runtime implicit initialization on GPU:0 failed. Status: unknown error
Traceback (most recent call last):
File "object_detection.py", line 302, in <module>
main()
File "object_detection.py", line 298, in main
detection(graph, category, score, expand)
File "object_detection.py", line 181, in detection
with tf.Session(graph=detection_graph,config=config) as sess:
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1522, in __init__
super(Session, self).__init__(target, graph, config=config)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 638, in __init__
self._session = tf_session.TF_NewDeprecatedSession(opts, status)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/errors_impl.py", line 516, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InternalError: Failed to create session.
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "object_detection.py", line 302, in <module>
main()
File "object_detection.py", line 298, in main
detection(graph, category, score, expand)
File "object_detection.py", line 181, in detection
with tf.Session(graph=detection_graph,config=config) as sess:
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1522, in __init__
super(Session, self).__init__(target, graph, config=config)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 638, in __init__
self._session = tf_session.TF_NewDeprecatedSession(opts, status)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/errors_impl.py", line 516, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InternalError: Failed to create session.