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

TypeError: The numpy boolean negative, the - operator, is not supported, use the ~ operator or the logical_not function instead. #76

Open
vinayakumarr opened this issue Dec 17, 2017 · 4 comments

Comments

@vinayakumarr
Copy link

python preprocess.py data/smiles_50k.h5 data/processed_50k.h5

Traceback (most recent call last):
File "preprocess.py", line 85, in
main()
File "preprocess.py", line 72, in main
apply_fn=lambda ch: np.array(map(one_hot_encoded_fn,
File "preprocess.py", line 63, in create_chunk_dataset
chunks=tuple([chunk_size]+list(dataset_shape[1:])))
File "/home/vinay/chemistrytensor/local/lib/python2.7/site-packages/h5py/_hl/group.py", line 105, in create_dataset
dsid = dataset.make_new_dset(self, shape, dtype, data, **kwds)
File "/home/vinay/chemistrytensor/local/lib/python2.7/site-packages/h5py/_hl/dataset.py", line 76, in make_new_dset
if isinstance(chunks, tuple) and (-numpy.array([ i>=j for i,j in zip(tmp_shape,chunks) if i is not None])).any():
TypeError: The numpy boolean negative, the - operator, is not supported, use the ~ operator or the logical_not function instead.

@maksak
Copy link

maksak commented Mar 26, 2018

Hi,

I think newer h5py solve this issue as the latest h5py seems to avoid your issue.
See: https://github.com/h5py/h5py/blob/master/h5py/_hl/dataset.py#L76

@3R1K
Copy link

3R1K commented Oct 11, 2018

I can confirm @maksak answer works...pip install h5py --upgrade did the trick for me.

@chshangy
Copy link

I have the same problem, just open your file File "/home/vinay/chemistrytensor/local/lib/python2.7/site-packages/h5py/_hl/dataset.py", line 76
change the "-" to "~".

@mukaddesau
Copy link

You can update your h5py file using this fix: h5py/h5py@973c47f
I hope it works.

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

5 participants