titu1994 / tf_SIREN

Tensorflow 2.0 implementation of Sinusodial Representation networks (SIREN)
MIT License
149 stars 26 forks source link

TypeError reported when running with tensorflow2.0.0 #6

Closed Lynne-Zheng-Linfang closed 4 years ago

Lynne-Zheng-Linfang commented 4 years ago

Hi,

I was trying to run the example code train_cifar_inpainting_siren.py with tensorflow 2.0.0, however, it reported the following error:

Traceback (most recent call last):
  File "train_cifar_inpainting_siren.py", line 62, in <module>
    _ = model(dummy_input)
  File "/home/lynne/.local/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 891, in __call__
    outputs = self.call(cast_inputs, *args, **kwargs)
  File "/home/lynne/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/def_function.py", line 457, in __call__
    result = self._call(*args, **kwds)
  File "/home/lynne/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/def_function.py", line 503, in _call
    self._initialize(args, kwds, add_initializers_to=initializer_map)
  File "/home/lynne/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/def_function.py", line 408, in _initialize
    *args, **kwds))
  File "/home/lynne/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 1848, in _get_concrete_function_internal_garbage_collected
    graph_function, _, _ = self._maybe_define_function(args, kwargs)
  File "/home/lynne/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 2150, in _maybe_define_function
    graph_function = self._create_graph_function(args, kwargs)
  File "/home/lynne/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 2041, in _create_graph_function
    capture_by_value=self._capture_by_value),
  File "/home/lynne/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/func_graph.py", line 915, in func_graph_from_py_func
    func_outputs = python_func(*func_args, **func_kwargs)
  File "/home/lynne/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/def_function.py", line 358, in wrapped_fn
    return weak_wrapped_fn().__wrapped__(*args, **kwds)
  File "/home/lynne/.local/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 2658, in bound_method_wrapper
    return wrapped_fn(*args, **kwargs)
  File "/home/lynne/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/func_graph.py", line 905, in wrapper
    raise e.ag_error_metadata.to_exception(e)
TypeError: in converted code:
    relative to /home/lynne:

    Downloads/tf_SIREN-master_new/tf_SIREN-master/tf_siren/hypernet.py:95 call  *
        param_list = self.hyper_net(embeddings)
    .local/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py:847 __call__
        outputs = call_fn(cast_inputs, *args, **kwargs)
    Downloads/tf_SIREN-master_new/tf_SIREN-master/tf_siren/meta/meta_siren_mlp.py:99 call  *
        params = layer(context=context)

    TypeError: __call__() missing 1 required positional argument: 'inputs'

Any way to solve this problem? Thanks a lot.

titu1994 commented 4 years ago

Please try with the latest tensorflow version from pip.

Lynne-Zheng-Linfang commented 4 years ago

Please try with the latest tensorflow version from pip.

Thanks. When upgraded to tensorflow 2.2.0, it works.