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

FYI - Scaler fails to load under sklearn >= 0.23 #3

Open
daisukelab opened this issue Jul 10, 2021 · 0 comments
Open

FYI - Scaler fails to load under sklearn >= 0.23 #3

daisukelab opened this issue Jul 10, 2021 · 0 comments

Comments

@daisukelab
Copy link

daisukelab commented Jul 10, 2021

Hi,

This is for sharing a possible issue who prefers a newer sklearn.
it seems that a new member variable has been added to the MinMaxScaler.

model = return_loaded_model(AudioEncoder, 'coala/saved_models/dual_ae_c/audio_encoder_epoch_200.pt')
extract_audio_embedding_chunks(model, '/data/UrbanSound8K/audio/fold1/101415-3-0-3.wav')
# --> fails with this error: 'MinMaxScaler' object has no attribute 'clip' /data/UrbanSound8K/audio/fold1/101415-3-0-3.wav

https://github.com/scikit-learn/scikit-learn/blob/2beed5584/sklearn/preprocessing/_data.py#L248

I wanted to work with the newer sklearn, then I manually added the new member as follows.

>>> a = pickle.load(open('coala/scaler_top_1000.pkl', 'rb'))
>>> a
MinMaxScaler(copy=True, feature_range=(0, 1))
>>> a.clip =False
>>> f = open('coala/scaler_top_1000_plus_clip.pkl', 'wb')
>>> pickle.dump(a, f)
>>> f.close()

I guess you might want to update the scaler_top_1000.pkl in this repo.

P.S. Thank you for sharing your code!

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

No branches or pull requests

1 participant