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

AttributeError: module 'numpy' has no attribute 'float128' #44

Open
taxus13 opened this issue Jul 28, 2018 · 4 comments
Open

AttributeError: module 'numpy' has no attribute 'float128' #44

taxus13 opened this issue Jul 28, 2018 · 4 comments

Comments

@taxus13
Copy link

taxus13 commented Jul 28, 2018

Hi,
I was trying to run this example to test WTTE. However, the cell "Format tensor for training" won't execute on my machine:

    C:\Python36\python-3.6.2.amd64\lib\site-packages\wtte\transforms.py in normalize_padded(padded, 
    means, stds, only_nonzero, epsilon)
        527         else:
        528             vals = padded.reshape(n_obs, n_features)
    --> 529         means = np.nanmean(vals, axis=0, keepdims=False, dtype=np.float128)
        530         del vals
        531 

AttributeError: module 'numpy' has no attribute 'float128'

I am using WinPython with

  • Python 3.6.2
  • numpy 1.14.5
  • wtte 1.1.1
  • tensorflow-gpu 1.9.0
  • keras 2.2.0

This issue suggests, that numpy compiled with MKL does not support float128.
The Mailinglist recommends to replace np.float128 with np.longdouble.

I can try to fix this, do you have any PR guidelines?

@taxus13
Copy link
Author

taxus13 commented Jul 28, 2018

I fixed it here: https://github.com/taxus13/wtte-rnn/tree/bugfix/float-fix-for-mkl

However, some tests are failing:

  1. test_discrete_padded_pipeline: different dtypes int64/int32
  2. test_padded_between (same)
  3. test_censoring_funs_no_time_discrete (AssertionError: not_censored failed)
  4. test_censoring_funs_with_time_discrete (same)

@ragulpr
Copy link
Owner

ragulpr commented Jul 30, 2018

Nice catch, did not try with MKL before! None of those test should be affected by your commit so it's a sign that they are failing due to your local environment. What's your pandas version? That could affect 1-2.

Guidelines: Checkout development and submit your PR with changes to that.

@taxus13
Copy link
Author

taxus13 commented Jul 30, 2018

I have the most recent pandas 0.23.1

It seems that master is ahead of development and I branched from master. Can you rebase develop on master?

@ragulpr
Copy link
Owner

ragulpr commented Aug 15, 2018

Done! Sorry for slow response, been afk

@ragulpr ragulpr mentioned this issue Aug 16, 2018
5 tasks
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

2 participants