小编Bob*_*ers的帖子

AttributeError:“MinMaxScaler”对象没有属性“clip”

当我尝试加载已保存的文件时出现以下错误sklearn.preprocessing.MinMaxScaler

/shared/env/lib/python3.6/site-packages/sklearn/base.py:315: UserWarning: Trying to unpickle estimator MinMaxScaler from version 0.23.2 when using version 0.24.0. This might lead to breaking code or invalid results. Use at your own risk.
  UserWarning)
[2021-01-08 19:40:28,805 INFO train.py:1317 - main ] EXCEPTION WORKER 100: 
Traceback (most recent call last):
  ...
  File "/shared/core/simulate.py", line 129, in process_obs
    obs = scaler.transform(obs)
  File "/shared/env/lib/python3.6/site-packages/sklearn/preprocessing/_data.py", line 439, in transform
    if self.clip:
AttributeError: 'MinMaxScaler' object has no attribute 'clip'
Run Code Online (Sandbox Code Playgroud)

我在一台机器上训练缩放器,保存它,然后将其推送到第二台机器,在第二台机器上加载它并用于转换输入。

# loading and transforming
import joblib
from sklearn.preprocessing …
Run Code Online (Sandbox Code Playgroud)

python scikit-learn joblib

8
推荐指数
2
解决办法
2万
查看次数

标签 统计

joblib ×1

python ×1

scikit-learn ×1