When running the training script right after following the installation instructions this error occurs:
File "train_nerd.py", line 9, in <module>
import dataflow.nerd as data
File "/tmp/NeRD-Neural-Reflectance-Decomposition/dataflow/nerd/__init__.py", line 4, in <module>
from dataflow.nerd.dataflow import add_args, create_dataflow
File "/tmp/NeRD-Neural-Reflectance-Decomposition/dataflow/nerd/dataflow.py", line 3, in <module>
import tensorflow_addons as tfa
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/tensorflow_addons/__init__.py", line 21, in <module>
from tensorflow_addons import activations
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/tensorflow_addons/activations/__init__.py", line 17, in <module>
from tensorflow_addons.activations.gelu import gelu
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/tensorflow_addons/activations/gelu.py", line 19, in <module>
from tensorflow_addons.utils.types import TensorLike
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/tensorflow_addons/utils/types.py", line 24, in <module>
from keras.engine import keras_tensor
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/keras/__init__.py", line 25, in <module>
from keras import models
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/keras/models.py", line 20, in <module>
from keras import metrics as metrics_module
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/keras/metrics.py", line 26, in <module>
from keras import activations
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/keras/activations.py", line 20, in <module>
from keras.layers import advanced_activations
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/keras/layers/__init__.py", line 23, in <module>
from keras.engine.input_layer import Input
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/keras/engine/input_layer.py", line 21, in <module>
from keras.engine import base_layer
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/keras/engine/base_layer.py", line 43, in <module>
from keras.mixed_precision import loss_scale_optimizer
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/keras/mixed_precision/loss_scale_optimizer.py", line 18, in <module>
from keras import optimizers
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/keras/optimizers.py", line 26, in <module>
from keras.optimizer_v2 import adadelta as adadelta_v2
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/keras/optimizer_v2/adadelta.py", line 22, in <module>
from keras.optimizer_v2 import optimizer_v2
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/keras/optimizer_v2/optimizer_v2.py", line 36, in <module>
keras_optimizers_gauge = tf.__internal__.monitoring.BoolGauge(
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/tensorflow/python/eager/monitoring.py", line 360, in __init__
super(BoolGauge, self).__init__('BoolGauge', _bool_gauge_methods,
File "/usr/local/google/home/martinarroyo/miniconda3/envs/nerd-tmp/lib/python3.8/site-packages/tensorflow/python/eager/monitoring.py", line 135, in __init__
self._metric = self._metric_methods[self._label_length].create(*args)
tensorflow.python.framework.errors_impl.AlreadyExistsError: Another metric with the same name already exists.
This occurs directly in the imports, and it seems to be fixed by upgrading the required version of TensorFlow from 2.6.0
to 2.6.2
. Since this does only affect the patch version number, it should not introduce any breaking changes.