{"record":{"id":"33072aa2c7667f2d","repo":"tensorflow/models","slug":"expected-input-and-output-states-to-be-the-same-g","errorCode":null,"errorMessage":"Expected input and output states to be the same. Got extra states {}, expected {}","messagePattern":"Expected input and output states to be the same\\. Got extra states (.+?), expected (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/movinet/modeling/movinet_model.py","lineNumber":126,"sourceCode":"      states: a dict of model states.\n    \"\"\"\n    state_specs = state_specs if state_specs is not None else {}\n\n    states = {\n        name: tf_keras.Input(shape=spec.shape[1:], dtype=spec.dtype, name=name)\n        for name, spec in state_specs.items()\n    }\n    image = tf_keras.Input(shape=input_specs['image'].shape[1:], name='image')\n    inputs = {**states, 'image': image}\n\n    if backbone.use_external_states:\n      before_states = states\n      endpoints, states = backbone(inputs)\n      after_states = states\n\n      new_states = set(after_states) - set(before_states)\n      if new_states:\n        raise ValueError(\n            'Expected input and output states to be the same. Got extra states '\n            '{}, expected {}'.format(new_states, set(before_states)))\n\n      mismatched_shapes = {}\n      for name in after_states:\n        before_shape = before_states[name].shape\n        after_shape = after_states[name].shape\n        if len(before_shape) != len(after_shape):\n          mismatched_shapes[name] = (before_shape, after_shape)\n          continue\n        for before, after in zip(before_shape, after_shape):\n          if before is not None and after is not None and before != after:\n            mismatched_shapes[name] = (before_shape, after_shape)\n            break\n      if mismatched_shapes:\n        raise ValueError(\n            'Got mismatched input and output state shapes: {}'.format(\n                mismatched_shapes))","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/movinet/modeling/movinet_model.py#L108-L144","documentation":"Error \"Expected input and output states to be the same. Got extra states {}, expected {}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/movinet/modeling/movinet_model.py:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}