payload: {"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/35002","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/35002/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/35002/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/35002/events","html_url":"https://github.com/tensorflow/tensorflow/issues/35002","id":535855242,"node_id":"MDU6SXNzdWU1MzU4NTUyNDI=","number":35002,"title":"Inconsistent loading of saved model","user":{"login":"fonnesbeck","id":81476,"node_id":"MDQ6VXNlcjgxNDc2","avatar_url":"https://avatars3.githubusercontent.com/u/81476?v=4","gravatar_id":"","url":"https://api.github.com/users/fonnesbeck","html_url":"https://github.com/fonnesbeck","followers_url":"https://api.github.com/users/fonnesbeck/followers","following_url":"https://api.github.com/users/fonnesbeck/following{/other_user}","gists_url":"https://api.github.com/users/fonnesbeck/gists{/gist_id}","starred_url":"https://api.github.com/users/fonnesbeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fonnesbeck/subscriptions","organizations_url":"https://api.github.com/users/fonnesbeck/orgs","repos_url":"https://api.github.com/users/fonnesbeck/repos","events_url":"https://api.github.com/users/fonnesbeck/events{/privacy}","received_events_url":"https://api.github.com/users/fonnesbeck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-12-10T16:48:03Z","updated_at":"2019-12-11T16:40:27Z","closed_at":null,"author_association":"NONE","body":"**System information**\r\n- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Debian Linux\r\n- TensorFlow installed from (source or binary): binary\r\n- TensorFlow version (use command below): 2.0.0\r\n- Python version: 3.7.3\r\n\r\n**Describe the current behavior**\r\n\r\nI have several models saved using `model.save` as hdf5 objects. However, when I try to load them from a script via:\r\n\r\n```python\r\ntf.keras.models.load_model(DATA_DIR + \"models/{}.h5\".format(filename))\r\n```\r\n\r\nI get an I/O error:\r\n\r\n```\r\n\"Unable to open object (file read failed: time = Tue Dec 10 16:36:14 2019\\n, filename = '/home/fonnesbeck/models/Slider-rhb-rhp-attack.h5', file descriptor = 14, errno = 5, error message = 'Input/output error', buf = 0x7f642c733da0, total read size = 272, bytes this sub-read = 272, bytes actually read = 18446744073709551615, offset = 8443360)\"\r\n```\r\n\r\nYet, when I manually go in and import the file manually from the terminal, it works fine:\r\n\r\n```\r\n>>> import tensorflow as tf\r\n>>> tf.keras.models.load_model('Slider-rhb-rhp-attack.h5')\r\n2019-12-10 16:34:45.948071: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions tha\r\nt this TensorFlow binary was not compiled to use: AVX2 FMA\r\n2019-12-10 16:34:46.355657: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\r\n2019-12-10 16:34:46.356406: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x557d96a7f470 executing \r\ncomputations on platform Host. Devices:\r\n2019-12-10 16:34:46.356451: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): Host, De\r\nfault Version\r\n<tensorflow.python.keras.engine.sequential.Sequential object at 0x7fa474307400>\r\n```\r\n\r\nEven stranger, after having done the manual import, running the script works fine. this seems to happen with every new file.\r\n"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/564629591","html_url":"https://github.com/tensorflow/tensorflow/issues/35002#issuecomment-564629591","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/35002","id":564629591,"node_id":"MDEyOklzc3VlQ29tbWVudDU2NDYyOTU5MQ==","user":{"login":"fonnesbeck","id":81476,"node_id":"MDQ6VXNlcjgxNDc2","avatar_url":"https://avatars3.githubusercontent.com/u/81476?v=4","gravatar_id":"","url":"https://api.github.com/users/fonnesbeck","html_url":"https://github.com/fonnesbeck","followers_url":"https://api.github.com/users/fonnesbeck/followers","following_url":"https://api.github.com/users/fonnesbeck/following{/other_user}","gists_url":"https://api.github.com/users/fonnesbeck/gists{/gist_id}","starred_url":"https://api.github.com/users/fonnesbeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fonnesbeck/subscriptions","organizations_url":"https://api.github.com/users/fonnesbeck/orgs","repos_url":"https://api.github.com/users/fonnesbeck/repos","events_url":"https://api.github.com/users/fonnesbeck/events{/privacy}","received_events_url":"https://api.github.com/users/fonnesbeck/received_events","type":"User","site_admin":false},"created_at":"2019-12-11T16:40:27Z","updated_at":"2019-12-11T16:40:27Z","author_association":"NONE","body":"I've tried this with 2.1.0.rc1, but now get the following:\r\n\r\n```\r\nOSError: SavedModel file does not exist at: ./models/my_model.h5/{saved_model.pbtxt|saved_model.pb}\r\n```\r\n\r\nWhy is it now looking for a SavedModel when I've passed it a `h5` extension in the string? The documentation says it should recognize this."}}
other: {"actor":{"display_login":"fonnesbeck"}}