Ali Ahmed55 نشر منذ 5 ساعة أرسل تقرير نشر منذ 5 ساعة السلام عليكم ده الكود col = ['D1','D2','D3','D4','D5','D6','D7','D8','D9','E1','E10','E11','E12','E13','E14', 'E15','E16','E17','E18','E19','E2','E20','E3','E4','E5','E6','E7','E8','E9','I1', 'I2','I3','I4','I5','I6','I7','I8','I9','M1','M10','M11','M12','M13','M14','M15', 'M16','M17','M18','M2','M3','M4','M5','M6','M7','M8','M9','P1','P10','P11','P12', 'P13','P2','P3','P4','P5','P6','P7','P8','P9','S1','S10','S11','S12','S2','S3', 'S4','S5','S6','S7','S8','S9','V1','V10','V11','V12','V13','V2','V3','V4','V5', 'V6','V7','V8','V9','is_scored','lagged_risk_free_rate', 'lagged_market_forward_excess_returns'] model = tf.keras.models.load_model('AlphaPulse.keras') def predict(test: pd.DataFrame) -> float: df = test df_copy = data_test_copy x_test = df[col] preds = model.predict(x_test) allocation = preds.clip(0, 2).reshape(-1) return pd.DataFrame({"date_id": df_copy["date_id"].values,"prediction": allocation}) inference_server = kaggle_evaluation.default_inference_server.DefaultInferenceServer(predict) if os.getenv('KAGGLE_IS_COMPETITION_RERUN'): inference_server.serve() else: inference_server.run_local_gateway(('/kaggle/input/hull-tactical-market-prediction/',)) ودي المشكله الناتج عن الكود ده --------------------------------------------------------------------------- GatewayRuntimeError Traceback (most recent call last) /tmp/ipykernel_39/3513852296.py in <cell line: 0>() 38 inference_server.serve() 39 else: ---> 40 inference_server.run_local_gateway(('/kaggle/input/hull-tactical-market-prediction/',)) /kaggle/input/hull-tactical-market-prediction/kaggle_evaluation/core/templates.py in run_local_gateway(self, data_paths, file_share_dir, *args, **kwargs) 106 self.gateway.run() 107 except Exception as err: --> 108 raise err from None 109 finally: 110 self.server.stop(0) /kaggle/input/hull-tactical-market-prediction/kaggle_evaluation/core/templates.py in run_local_gateway(self, data_paths, file_share_dir, *args, **kwargs) 104 try: 105 self.gateway = self._get_gateway_for_test(data_paths, file_share_dir, *args, **kwargs) --> 106 self.gateway.run() 107 except Exception as err: 108 raise err from None /kaggle/input/hull-tactical-market-prediction/kaggle_evaluation/core/base_gateway.py in run(self) 149 elif error: 150 # For local testing --> 151 raise error 152 153 @final /kaggle/input/hull-tactical-market-prediction/kaggle_evaluation/core/base_gateway.py in run(self) 130 try: 131 self.unpack_data_paths() --> 132 predictions, row_ids = self.get_all_predictions() 133 self.write_submission(predictions, row_ids) 134 except GatewayRuntimeError as gre: /kaggle/input/hull-tactical-market-prediction/kaggle_evaluation/core/base_gateway.py in get_all_predictions(self) 106 self.data_batch_counter = 0 107 for data_batch, row_ids in self.generate_data_batches(): --> 108 predictions = self.predict(*data_batch) 109 self.competition_agnostic_validation(predictions, row_ids) 110 self.competition_specific_validation(predictions, row_ids, data_batch) /kaggle/input/hull-tactical-market-prediction/kaggle_evaluation/core/base_gateway.py in predict(self, *args, **kwargs) 124 return self.client.send('predict', *args, **kwargs) 125 except Exception as e: --> 126 self.handle_server_error(e, 'predict') 127 128 def run(self) -> None: /kaggle/input/hull-tactical-market-prediction/kaggle_evaluation/core/base_gateway.py in handle_server_error(self, exception, endpoint) 429 message_match = re.search('"Exception calling application: (.*)"', exception_str, re.IGNORECASE) 430 message = message_match.group(1) if message_match else exception_str --> 431 raise GatewayRuntimeError(GatewayRuntimeErrorType.SERVER_RAISED_EXCEPTION, message) from None 432 if isinstance(exception, grpc._channel._InactiveRpcError): 433 raise GatewayRuntimeError(GatewayRuntimeErrorType.SERVER_CONNECTION_FAILED, exception_str) from None GatewayRuntimeError: (<GatewayRuntimeErrorType.SERVER_RAISED_EXCEPTION: 3>, 'All arrays must be of the same length') اقتباس
السؤال
Ali Ahmed55
السلام عليكم
ده الكود
ودي المشكله الناتج عن الكود ده
0 أجوبة على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.