# tf_agents.policies.policy_saver.specs_from_collect_data_spec

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/policies/policy_saver.py#L769-L812) |

Creates policy specs from specs loaded from disk.

    tf_agents.policies.policy_saver.specs_from_collect_data_spec(
        loaded_policy_specs: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedTensorSpec
    ) -> Dict[https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedSpec, https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedSpec]

The PolicySaver saves policy specs next to the saved model as
a `struct.StructuredValue` proto. This recreates the
original specs from the proto.

Pass the proto loaded from the file with [`tensor_spec.from_pbtxt_file()`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/tensor_spec/from_pbtxt_file)
to this function.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `loaded_policy_specs` | `struct.StructuredValue` proto that had been previously created by PolicySaver as a pbtxt. |

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A dict with specs extracted from the proto. The dict contains the following keys and values. Except `time_step_spec` all the specs are nests of `ArraySpecs`. <br /> - `collect_data_spec`: Collect data spec for the policy. - `time_step_spec`: `TimeStepSpec` for the policy. - `action_spec`: Action spec for the policy - `policy_state_spec`: State spec for the policy. - `info_spec`: Info spec for the policy. ||

<br />