Stanford-STAGES / stanford-stages

Automated sleep staging scoring and narcolepsy identification
76 stars 26 forks source link

Stanford-Manuscript: AttributeError: 'Dataset' object has no attribute 'value' #32

Closed RaghavRao closed 3 years ago

RaghavRao commented 3 years ago

Has anyone run into this before? It happens right at the end, when trying to assign the score. This was with CHP040.edf on the manuscript branch Traceback:

2020-11-25 17:23:21.144521 | Predicting using: ac_rh_ls_lstm_01
Traceback (most recent call last):
  File "inf_narco_app.py", line 302, in <module>
    main(edfFile, jsonObj)
  File "inf_narco_app.py", line 124, in main
    print(narcoApp.get_diagnosis())
  File "inf_narco_app.py", line 185, in get_diagnosis
    prediction = self.get_narco_prediction()
  File "inf_narco_app.py", line 243, in get_narco_prediction
    os.path.join(gpmodels_base_path, gpmodel, gpmodel + '_fold{:02}.gpm'.format(k + 1)))
  File "/home/user/Envs/stanford-manuscript/lib/python3.6/site-packages/gpflow/saver/saver.py", line 41, in load
    encoded_target = context.serializer(context).load(pathname)
  File "/home/user/Envs/stanford-manuscript/lib/python3.6/site-packages/gpflow/saver/serializers.py", line 48, in load
    return h5file['data'].value
AttributeError: 'Dataset' object has no attribute 'value'
informaton commented 3 years ago

I have seen this issue before when the h5py package is more recent than what is supported by the gpflow package.
I'm using h5py version 2.10.0 for the manuscript branch and it only gives a deprecation warning about the 'Dataset' object's 'value' attribute.

Try downgrading your h5py package. If you are using pip, it should be pip install h5py==2.10

RaghavRao commented 3 years ago

Thank you. I noticed some of the packages in the requirements.txt for the manuscript branch aren't pinned, so on newer installs it causes conflicts. I pip freeze'd a working environment and I'll reply with a fixed requirements.txt soon.

On Fri, Jan 29, 2021, 15:40 Hyatt Moore IV notifications@github.com wrote:

I have seen this issue before when the h5py package is more recent than what is supported by the gpflow package. I'm using hypy version 2.10.0 for the manuscript branch and it only gives a deprecation warning about the 'Dataset' object's 'value' attribute.

Try downgrading your h5py package. If you are using pip, it should be pip install h5py==2.10

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Stanford-STAGES/stanford-stages/issues/32#issuecomment-770037772, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUBDUZFQ6VWUZGVGIHY7HLS4MMLFANCNFSM4UC6ZN6Q .