evaluation phase for object 8 of linemod -- raise ValueError('Unexpectedly found an instance of type `' + str(type(x)) + ValueError: Unexpectedly found an instance of type `<class 'keras.src.engine.keras_tensor.KerasTensor'>`. Expected a symbolic tensor instance. #71
I am getting this error in TensorFlow 2.0 for evaluation
(effpose) mona@ada:~/effpose_new/EfficientPose$ python evaluate.py --phi 0 --weights weights/Weights/Linemod/object_8/phi_0_linemod_best_ADD.h5 --validation-image-save-path val_imgs linemod ./data/Linemod_preprocessed/ --object-id 8
2023-11-28 15:55:47.220295: I tensorflow/core/util/port.cc:111] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2023-11-28 15:55:47.257482: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2023-11-28 15:55:47.257531: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2023-11-28 15:55:47.257560: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2023-11-28 15:55:47.264950: 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 AVX512F AVX512_VNNI AVX512_BF16 AVX_VNNI AMX_TILE AMX_INT8 AMX_BF16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-11-28 15:55:48.840055: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1886] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 45076 MB memory: -> device: 0, name: NVIDIA RTX 6000 Ada Generation, pci bus id: 0000:52:00.0, compute capability: 8.9
{'dataset_type': 'linemod', 'rotation_representation': 'axis_angle', 'weights': 'weights/Weights/Linemod/object_8/phi_0_linemod_best_ADD.h5', 'batch_size': 1, 'phi': 0, 'gpu': None, 'score_threshold': 0.5, 'validation_image_save_path': 'val_imgs', 'linemod_path': './data/Linemod_preprocessed/', 'object_id': 8}
Creating the Generators...
Done!
Building the Model...
input shape: (512, 512, 3)
type(image_input): <class 'keras.src.engine.keras_tensor.KerasTensor'>
image_input shape: (None, 512, 512, 3)
input_tensor shape is (None, 512, 512, 3)
type input_tensor: <class 'keras.src.engine.keras_tensor.KerasTensor'>
Traceback (most recent call last):
File "/home/mona/effpose_new/EfficientPose/evaluate.py", line 370, in <module>
main()
File "/home/mona/effpose_new/EfficientPose/evaluate.py", line 111, in main
_, prediction_model, _ = build_EfficientPose(args.phi,
File "/home/mona/effpose_new/EfficientPose/model.py", line 105, in build_EfficientPose
backbone_feature_maps = backbone_class(input_tensor = image_input, freeze_bn = freeze_bn)
File "/home/mona/effpose_new/EfficientPose/utils/__init__.py", line 61, in wrapper
return func(*args, **kwargs)
File "/home/mona/effpose_new/EfficientPose/efficientnet.py", line 459, in EfficientNetB0
return EfficientNet(1.0, 1.0, 224, 0.2,
File "/home/mona/effpose_new/EfficientPose/efficientnet.py", line 386, in EfficientNet
if not is_keras_tensor(input_tensor):
File "/home/mona/anaconda3/envs/effpose/lib/python3.10/site-packages/tensorflow/python/keras/backend.py", line 1248, in is_keras_tensor
raise ValueError('Unexpectedly found an instance of type `' + str(type(x)) +
ValueError: Unexpectedly found an instance of type `<class 'keras.src.engine.keras_tensor.KerasTensor'>`. Expected a symbolic tensor instance.
(base) mona@ada:~$ lsb_release -a
LSB Version: core-11.1.0ubuntu4-noarch:security-11.1.0ubuntu4-noarch
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
(base) mona@ada:~$ uname -a
Linux ada 6.2.0-37-generic #38~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 2 18:01:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
(base) mona@ada:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0
(base) mona@ada:~$ nvidia-smi
Tue Nov 28 15:58:14 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.104.12 Driver Version: 535.104.12 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA RTX 6000 Ada Gene... On | 00000000:52:00.0 On | Off |
| 30% 43C P8 27W / 300W | 1597MiB / 49140MiB | 13% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 2317 G /usr/lib/xorg/Xorg 608MiB |
| 0 N/A N/A 2519 G /usr/bin/gnome-shell 107MiB |
| 0 N/A N/A 2994 G ...AAAAAAAACAAAAAAAAAA= --shared-files 100MiB |
| 0 N/A N/A 25264 G ...0208189,17325718055376231948,262144 44MiB |
| 0 N/A N/A 652962 G ...irefox/3358/usr/lib/firefox/firefox 288MiB |
| 0 N/A N/A 703622 G blender 227MiB |
| 0 N/A N/A 810224 G ...sion,SpareRendererForSitePerProcess 101MiB |
| 0 N/A N/A 829624 G /usr/bin/gnome-control-center 7MiB |
+---------------------------------------------------------------------------------------+
I have
(effpose) mona@ada:~/effpose_new/EfficientPose$ python
Python 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
I am getting this error in TensorFlow 2.0 for evaluation
sys info:
I have