drawbridge / keras-mmoe

A TensorFlow Keras implementation of "Modeling Task Relationships in Multi-task Learning with Multi-gate Mixture-of-Experts" (KDD 2018)
MIT License
681 stars 217 forks source link

some questions in run model about TypeError! #14

Closed Hello-Rest closed 2 years ago

Hello-Rest commented 3 years ago

when I run the example census_income_demo.py, a problem occured,I dont know how to solve it,can you give some advices? thanks.

Training data shape = (10000, 100) Validation data shape = (1000, 100) Test data shape = (1000, 100) Traceback (most recent call last): File "E:\softWare\conda\envs\AppKG\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 558, in make_tensor_proto str_values = [compat.as_bytes(x) for x in proto_values] File "E:\softWare\conda\envs\AppKG\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 558, in str_values = [compat.as_bytes(x) for x in proto_values] File "E:\softWare\conda\envs\AppKG\lib\site-packages\tensorflow\python\util\compat.py", line 65, in as_bytes (bytes_or_text,)) TypeError: Expected binary or unicode string, got Dimension(100)

During handling of the above exception, another exception occurred:

File "E:\softWare\conda\envs\AppKG\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 562, in make_tensor_proto "supported type." % (type(values), values)) TypeError: Failed to convert object of type <class 'tuple'> to Tensor. Contents: (Dimension(100), 16, 8). Consider casting elements to a supported type.

alvin319 commented 3 years ago

Hello! We recently have updated our implementation to TensorFlow 2.5 and merged the Keras logic altogether since it's now a part of the TensorFlow library now - can you try that again?