{"record":{"id":"1acb0af316bcd83b","repo":"keras-team/keras","slug":"when-specifying-crosses-the-argument-crossing","errorCode":null,"errorMessage":"When specifying `crosses`, the argument `crossing_dim` (dimensionality of the crossing space) should be specified as well.","messagePattern":"When specifying `crosses`, the argument `crossing_dim` \\(dimensionality of the crossing space\\) should be specified as well\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/preprocessing/feature_space.py","lineNumber":417,"sourceCode":"            raise ValueError(\"The `features` argument cannot be None or empty.\")\n        self.crossing_dim = crossing_dim\n        self.hashing_dim = hashing_dim\n        self.num_discretization_bins = num_discretization_bins\n        self.features = {\n            name: self._standardize_feature(name, value)\n            for name, value in features.items()\n        }\n        self.crosses = []\n        if crosses:\n            feature_set = set(features.keys())\n            for cross in crosses:\n                if isinstance(cross, dict):\n                    cross = serialization_lib.deserialize_keras_object(cross)\n                if isinstance(cross, Cross):\n                    self.crosses.append(cross)\n                else:\n                    if not crossing_dim:\n                        raise ValueError(\n                            \"When specifying `crosses`, the argument \"\n                            \"`crossing_dim` \"\n                            \"(dimensionality of the crossing space) \"\n                            \"should be specified as well.\"\n                        )\n                    for key in cross:\n                        if key not in feature_set:\n                            raise ValueError(\n                                \"All features referenced \"\n                                \"in the `crosses` argument \"\n                                \"should be present in the `features` dict. \"\n                                f\"Received unknown features: {cross}\"\n                            )\n                    self.crosses.append(Cross(cross, crossing_dim=crossing_dim))\n        self.crosses_by_name = {cross.name: cross for cross in self.crosses}\n\n        if output_mode not in {\"dict\", \"concat\"}:\n            raise ValueError(","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/preprocessing/feature_space.py#L399-L435","documentation":"FeatureSpace was constructed with crosses but without crossing_dim. Crossed features are hashed into a fixed-size space whose dimensionality must be declared (it cannot be inferred), so the constructor rejects a crosses list that has no accompanying crossing_dim.","triggerScenarios":"Thrown at keras/src/layers/preprocessing/feature_space.py:417 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass crossing_dim (e.g. crossing_dim=32) whenever crosses is non-empty","Provide a crossing_dim inside each cross dict if specifying crosses as dicts"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}