Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

None: marshal data too short #66

Open
benpaobamingliang1 opened this issue Nov 1, 2022 · 5 comments
Open

None: marshal data too short #66

benpaobamingliang1 opened this issue Nov 1, 2022 · 5 comments
Labels
question Further information is requested

Comments

@benpaobamingliang1
Copy link

Model: "DeepAR"


248/248 [==============================] - 50s 186ms/step - loss: 0.3978 - rmse: 0.9683 - val_loss: 0.4870 - val_rmse: 1.0712
11-01 11:08:17 E hypernets.e._experiment.py 106 - ExperimentID:[HyperTS_56148232a2a64822f2b6a0028102d580] - None: marshal data too short
Traceback (most recent call last):
File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hypernets\experiment_experiment.py", line 91, in run
y_eval=self.y_eval, **kwargs)
File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hypernets\experiment\compete.py", line 1551, in train
raise e
File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hypernets\experiment\compete.py", line 1543, in train
**kwargs)
File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hypernets\experiment\compete.py", line 1226, in fit_transform
**kwargs)
File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hyperts\framework\compete.py", line 287, in build_estimator
estimators = [hyper_model.load_estimator(trial.model_file) for trial in trials]
File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hyperts\framework\compete.py", line 287, in
estimators = [hyper_model.load_estimator(trial.model_file) for trial in trials]
File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hyperts\hyper_ts.py", line 478, in load_estimator
return HyperTSEstimator._load(model_file, self.mode)
File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hyperts\hyper_ts.py", line 398, in _load
model = BaseDeepEstimator.load_model(model_file)
File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hyperts\framework\dl_base.py", line 864, in load_model
model = load_model(h, custom_objects=custom_objects)
File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\keras\utils\traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\keras\utils\generic_utils.py", line 857, in func_load
code = marshal.loads(raw_code)
EOFError: marshal data too short
请问为什么会出现这样的问题呢,我训练时会出现这样的报错

@zhangxjohn
Copy link
Collaborator

根据您所提供的信息,无法判断。请提供可以复现以上错误的更多信息。

@benpaobamingliang1
Copy link
Author

好的,已QQ发您,谢谢您

@zhangxjohn
Copy link
Collaborator

遇到以上问题,建议检查tensorflow和numpy的版本兼容性问题。

@zhangxjohn zhangxjohn added the question Further information is requested label Nov 30, 2022
@happysaten
Copy link

happysaten commented Mar 25, 2024

Model: "DeepAR"

248/248 [==============================] - 50s 186ms/step - loss: 0.3978 - rmse: 0.9683 - val_loss: 0.4870 - val_rmse: 1.0712 11-01 11:08:17 E hypernets.e._experiment.py 106 - ExperimentID:[HyperTS_56148232a2a64822f2b6a0028102d580] - None: marshal data too short Traceback (most recent call last): File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hypernets\experiment_experiment.py", line 91, in run y_eval=self.y_eval, **kwargs) File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hypernets\experiment\compete.py", line 1551, in train raise e File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hypernets\experiment\compete.py", line 1543, in train **kwargs) File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hypernets\experiment\compete.py", line 1226, in fit_transform **kwargs) File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hyperts\framework\compete.py", line 287, in build_estimator estimators = [hyper_model.load_estimator(trial.model_file) for trial in trials] File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hyperts\framework\compete.py", line 287, in estimators = [hyper_model.load_estimator(trial.model_file) for trial in trials] File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hyperts\hyper_ts.py", line 478, in load_estimator return HyperTSEstimator._load(model_file, self.mode) File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hyperts\hyper_ts.py", line 398, in _load model = BaseDeepEstimator.load_model(model_file) File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\hyperts\framework\dl_base.py", line 864, in load_model model = load_model(h, custom_objects=custom_objects) File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\keras\utils\traceback_utils.py", line 70, in error_handler raise e.with_traceback(filtered_tb) from None File "D:\Program-SetUp\Anaconda\envs\TF2.3\lib\site-packages\keras\utils\generic_utils.py", line 857, in func_load code = marshal.loads(raw_code) EOFError: marshal data too short 请问为什么会出现这样的问题呢,我训练时会出现这样的报错

同样的问题,请问你解决了吗?我的python版本是3.8,tensorflow版本是2.10.1,numpy是1.2.1
运行以下代码时报错

from hyperts import make_experiment
from hyperts.datasets import load_basic_motions

from sklearn.metrics import f1_score
from sklearn.model_selection import train_test_split

data = load_basic_motions()
train_data, test_data = train_test_split(data, test_size=0.2)

experiment = make_experiment(train_data.copy(),
task='classification',
mode='dl',
tf_gpu_usage_strategy=1,
reward_metric='accuracy',
max_trials=30,
early_stopping_rounds=10)

model = experiment.run()

X_test, y_test = model.split_X_y(test_data.copy())

y_pred = model.predict(X_test)
y_proba = model.predict_proba(X_test)

scores = model.evaluate(y_test, y_pred, y_proba=y_proba, metrics=['accuracy', 'auc', f1_score])

print(scores)

@zhangxjohn
Copy link
Collaborator

zhangxjohn commented Mar 26, 2024

感谢提问!

CSDN有这么解决的:https://blog.csdn.net/weixin_41930058/article/details/124276016

这个错误以前的检查点判断,你的np和tf的版本大概率不匹配,tf现在的更新有些不管np。

我这边使用tf=2.4.0和np=1.19.5没有这种问题。你可以尝试更新一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants