nilmtk / nilmtk-contrib

Apache License 2.0
114 stars 59 forks source link

About the version of nilmtk-contrib #52

Closed jinweiisgreat closed 3 years ago

jinweiisgreat commented 3 years ago

Hi! I have three problems with NILMTK-contrib.

  1. My dataset has no 'apparent' ac_type, when I use experiment1 = { 'power': {'mains': ['active'],'appliance': ['active']}, 'sample_rate': 60, the error : nilmtk.exceptions.MeasurementError: AC type '['active']' not available. Available columns = [('power', 'apparent')]. ModuleNotFoundError: No module named 'tensorflow_core.estimator'

  2. The final results graph cannot show all curves. Like this: adf6c3ef15103badda3adffeb0bba86

  3. How to get the prediction results from models after training. I mean I need to get each electrical appliances data as input for the next experiment.

I find that when I use conda command to download NILMTK-contrib. The version of nilmtk-contrib is 0.1.0. But in the guide notebook, the version is 0.1.2. Should I update my nilmtk-contrib version to solve the first and the second problems?

Thanks!

PMeira commented 3 years ago

nilmtk.exceptions.MeasurementError: AC type '['active']' not available. Available columns = [('power', 'apparent')].

That's weird. I couldn't say much about that.

ModuleNotFoundError: No module named 'tensorflow_core.estimator'

I think the breaking changes from tensorflow 2.4 are responsible for that. Try downgrading tensorflow to 2.3 or 2.2.

The version of nilmtk-contrib is 0.1.0. But in the guide notebook, the version is 0.1.2.

We have nilmtk-contrib 0.1.1 available on conda. The development version is "0.1.2.dev...", that might be it. You can pass a version explicitly to conda to force it to install the correct one.

We'll probably release a 0.1.2 though to address the tensorflow issue in a few days.

PMeira commented 3 years ago

By the way, we have a badge/image in the README.md that lists the latest version available in conda:

conda package version

oneway3124 commented 3 years ago

But my tensorflow version is as follow,

tensorflow 1.14.0 h39a9291_0 conda-forge tensorflow-base 1.14.0 py36h9f0ad1d_0 conda-forge tensorflow-estimator 1.14.0 py36h5ca1d4c_0 conda-forge ![Uploading 微信截图_20210325150524.png…]()

PMeira commented 3 years ago

Please just give me the complete output of the conda list command then...

oneway3124 commented 3 years ago

This problem is fixed by reinstalling the conda environment. Thx!

PMeira commented 3 years ago

@oneway3124 Nice! Thanks for the update.

jinweiisgreat commented 3 years ago

@PMeira Thank you, Paulo! I have resolved these problems via modified my metadata. And, by the way, what version of matplotlib do you recommend? When I use API.py, you can see the first picture, the axis starts at 11-18 14. Actually, my test time setting is 11-18 to 11-19. But, in the second picture, I use the same .h5 file but no API.py, which is correct. My data time is Brisbane timezone, So, in my raw data, the time formate is "2019-11-18 00:00:00+10:00". image image

PMeira commented 3 years ago

And, by the way, what version of matplotlib do you recommend?

@WeiJiN-UQ Hm... I didn't notice that before with the API. I created another issue at https://github.com/nilmtk/nilmtk/issues/920

The issue you see stems from a limitation of matplotlib. When plotting through pandas, pandas handles the tzinfo correctly before passing it to matplotlib. When plotting directly through matplotlib, it discards the tzinfo, like the API.py plots. In the legacy plots, we already handle some of that. So, we need to handle that in the API too.

In the time being, as a workaround, you could try setting the timezone in matplotlib before plotting:

import matplotlib
matplotlib.rcParams['timezone'] = 'Australia/Brisbane'

For some projects, I keep a matplotlibrc file, per folder, with the timezone of the analysis to simplify general plotting. That's probably why I didn't notice this before.

jinweiisgreat commented 3 years ago

@PMeira Resolved! Thank you very much again!