payload: {"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/hub/issues/407","repository_url":"https://api.github.com/repos/tensorflow/hub","labels_url":"https://api.github.com/repos/tensorflow/hub/issues/407/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/hub/issues/407/comments","events_url":"https://api.github.com/repos/tensorflow/hub/issues/407/events","html_url":"https://github.com/tensorflow/hub/issues/407","id":520494970,"node_id":"MDU6SXNzdWU1MjA0OTQ5NzA=","number":407,"title":"KerasLayers are not trainable in Tensorflow 2.0.0","user":{"login":"r-wheeler","id":5184858,"node_id":"MDQ6VXNlcjUxODQ4NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/5184858?v=4","gravatar_id":"","url":"https://api.github.com/users/r-wheeler","html_url":"https://github.com/r-wheeler","followers_url":"https://api.github.com/users/r-wheeler/followers","following_url":"https://api.github.com/users/r-wheeler/following{/other_user}","gists_url":"https://api.github.com/users/r-wheeler/gists{/gist_id}","starred_url":"https://api.github.com/users/r-wheeler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-wheeler/subscriptions","organizations_url":"https://api.github.com/users/r-wheeler/orgs","repos_url":"https://api.github.com/users/r-wheeler/repos","events_url":"https://api.github.com/users/r-wheeler/events{/privacy}","received_events_url":"https://api.github.com/users/r-wheeler/received_events","type":"User","site_admin":false},"labels":[{"id":1273246758,"node_id":"MDU6TGFiZWwxMjczMjQ2NzU4","url":"https://api.github.com/repos/tensorflow/hub/labels/hub","name":"hub","color":"ffc4ff","default":false},{"id":1248458918,"node_id":"MDU6TGFiZWwxMjQ4NDU4OTE4","url":"https://api.github.com/repos/tensorflow/hub/labels/stat:awaiting%20tensorflower","name":"stat:awaiting tensorflower","color":"f4b400","default":false},{"id":1250156238,"node_id":"MDU6TGFiZWwxMjUwMTU2MjM4","url":"https://api.github.com/repos/tensorflow/hub/labels/subtype:text-embedding","name":"subtype:text-embedding","color":"93bfea","default":false},{"id":1248453551,"node_id":"MDU6TGFiZWwxMjQ4NDUzNTUx","url":"https://api.github.com/repos/tensorflow/hub/labels/type:feature","name":"type:feature","color":"159b2e","default":false}],"state":"open","locked":false,"assignee":{"login":"arnoegw","id":37290325,"node_id":"MDQ6VXNlcjM3MjkwMzI1","avatar_url":"https://avatars3.githubusercontent.com/u/37290325?v=4","gravatar_id":"","url":"https://api.github.com/users/arnoegw","html_url":"https://github.com/arnoegw","followers_url":"https://api.github.com/users/arnoegw/followers","following_url":"https://api.github.com/users/arnoegw/following{/other_user}","gists_url":"https://api.github.com/users/arnoegw/gists{/gist_id}","starred_url":"https://api.github.com/users/arnoegw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnoegw/subscriptions","organizations_url":"https://api.github.com/users/arnoegw/orgs","repos_url":"https://api.github.com/users/arnoegw/repos","events_url":"https://api.github.com/users/arnoegw/events{/privacy}","received_events_url":"https://api.github.com/users/arnoegw/received_events","type":"User","site_admin":false},"assignees":[{"login":"arnoegw","id":37290325,"node_id":"MDQ6VXNlcjM3MjkwMzI1","avatar_url":"https://avatars3.githubusercontent.com/u/37290325?v=4","gravatar_id":"","url":"https://api.github.com/users/arnoegw","html_url":"https://github.com/arnoegw","followers_url":"https://api.github.com/users/arnoegw/followers","following_url":"https://api.github.com/users/arnoegw/following{/other_user}","gists_url":"https://api.github.com/users/arnoegw/gists{/gist_id}","starred_url":"https://api.github.com/users/arnoegw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnoegw/subscriptions","organizations_url":"https://api.github.com/users/arnoegw/orgs","repos_url":"https://api.github.com/users/arnoegw/repos","events_url":"https://api.github.com/users/arnoegw/events{/privacy}","received_events_url":"https://api.github.com/users/arnoegw/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2019-11-09T18:29:50Z","updated_at":"2019-11-14T13:36:06Z","closed_at":null,"author_association":"NONE","body":"`tensorflow==2.0.0`\r\n`tensorflow-hub==0.7.0` \r\n\r\nWith a very minimal example, the weights of albert and other modules do not show as trainable.\r\n\r\n```\r\nimport tensorflow as tf \r\nimport tensorflow_hub as hub\r\n\r\ninput_ids = tf.keras.layers.Input(shape=[None], dtype=tf.int32)\r\ninput_mask = tf.keras.layers.Input(shape=[None], dtype=tf.int32)\r\nsequence_mask = tf.keras.layers.Input(shape=[None], dtype=tf.int32)\r\n\r\nalbert = hub.KerasLayer(\r\n    \"https://tfhub.dev/google/albert_xlarge/2\",\r\n    trainable=True,\r\n    signature=\"tokens\",\r\n    output_key=\"pooled_output\",\r\n)\r\n\r\nfeatures = {\r\n    \"input_ids\": input_ids,\r\n    \"input_mask\": input_mask,\r\n    \"segment_ids\": sequence_mask,\r\n}\r\nout = albert(features)\r\nmodel = tf.keras.Model(inputs=[input_ids, input_mask, sequence_mask], outputs=out)\r\nmodel.compile(\"adam\", loss=\"sparse_categorical_crossentropy\")\r\nmodel.summary()\r\n```\r\n\r\nProduces the following summary: \r\n```\r\nModel: \"model\"\r\n__________________________________________________________________________________________________\r\nLayer (type)                    Output Shape         Param #     Connected to                     \r\n==================================================================================================\r\ninput_28 (InputLayer)           [(None, None)]       0                                            \r\n__________________________________________________________________________________________________\r\ninput_29 (InputLayer)           [(None, None)]       0                                            \r\n__________________________________________________________________________________________________\r\ninput_30 (InputLayer)           [(None, None)]       0                                            \r\n__________________________________________________________________________________________________\r\nkeras_layer_60 (KerasLayer)     (None, 2048)         59017392    input_28[0][0]                   \r\n                                                                 input_29[0][0]                   \r\n                                                                 input_30[0][0]                   \r\n==================================================================================================\r\nTotal params: 59,017,392\r\nTrainable params: 0\r\nNon-trainable params: 59,017,392\r\n```\r\nExpected Behavior: Trainable variables of Albert or bert models to be shown as trainable parameters\r\n\r\nObserved Behavior: There are 0 trainable parameters shown in the model summary when setting trainable to `True`. \r\n\r\n#402 also mentions this with elmo. \r\n"},"comment":{"url":"https://api.github.com/repos/tensorflow/hub/issues/comments/553890524","html_url":"https://github.com/tensorflow/hub/issues/407#issuecomment-553890524","issue_url":"https://api.github.com/repos/tensorflow/hub/issues/407","id":553890524,"node_id":"MDEyOklzc3VlQ29tbWVudDU1Mzg5MDUyNA==","user":{"login":"arnoegw","id":37290325,"node_id":"MDQ6VXNlcjM3MjkwMzI1","avatar_url":"https://avatars3.githubusercontent.com/u/37290325?v=4","gravatar_id":"","url":"https://api.github.com/users/arnoegw","html_url":"https://github.com/arnoegw","followers_url":"https://api.github.com/users/arnoegw/followers","following_url":"https://api.github.com/users/arnoegw/following{/other_user}","gists_url":"https://api.github.com/users/arnoegw/gists{/gist_id}","starred_url":"https://api.github.com/users/arnoegw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnoegw/subscriptions","organizations_url":"https://api.github.com/users/arnoegw/orgs","repos_url":"https://api.github.com/users/arnoegw/repos","events_url":"https://api.github.com/users/arnoegw/events{/privacy}","received_events_url":"https://api.github.com/users/arnoegw/received_events","type":"User","site_admin":false},"created_at":"2019-11-14T13:36:05Z","updated_at":"2019-11-14T13:36:05Z","author_association":"COLLABORATOR","body":"@r-wheeler, thank you for reporting this. While I have no immediate solution for albert (that depends on the model publisher), at least commit https://github.com/tensorflow/hub/commit/a98a141209e6639e7ca3e44b458a289c45a828ee will provide clearer messaging for users in the future. It will go out eventually with tensorflow-hub 0.8.0."}}
other: {"actor":{"display_login":"arnoegw"}}