MingjunZhong / seq2point-nilm

Sequence-to-point learning for non-intrusive load monitoring
95 stars 32 forks source link

a small bug to request #7

Open ZigangLiu opened 2 years ago

ZigangLiu commented 2 years ago

1 ! python /content/seq2point-nilm/train_main.py

2021-10-28 09:11:45.132367: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA 2021-10-28 09:11:45.137674: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2299995000 Hz 2021-10-28 09:11:45.137931: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5628e544c840 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2021-10-28 09:11:45.137968: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version 2021-10-28 09:11:45.138216: I tensorflow/core/common_runtime/process_util.cc:147] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance. Importing training file... Traceback (most recent call last): File "/content/seq2point-nilm/train_main.py", line 32, in trainer.train_model() File "/content/seq2point-nilm/seq2point_train.py", line 112, in train_model training_history = self.default_train(model, callbacks, steps_per_training_epoch) File "/content/seq2point-nilm/seq2point_train.py", line 155, in default_train validation_steps=self.validation_steps) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 66, in _method_wrapper return method(self, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 815, in fit model=self) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/keras/engine/data_adapter.py", line 1112, in init model=model) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/keras/engine/data_adapter.py", line 772, in init peek, x = self._peek_and_restore(x) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/keras/engine/data_adapter.py", line 830, in _peek_and_restore peek = next(x) File "/content/seq2point-nilm/data_feeder.py", line 88, in load_dataset self.check_if_chunking() File "/content/seq2point-nilm/data_feeder.py", line 63, in check_if_chunking skiprows=self.skip_rows) File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 678, in parser_f return _read(filepath_or_buffer, kwds) File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 440, in _read parser = TextFileReader(filepath_or_buffer, **kwds) File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 787, in init__ self._make_engine(self.engine) File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 1014, in _make_engine self._engine = CParserWrapper(self.f, **self.options) File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 1708, in init__ self._reader = parsers.TextReader(src, **kwds) File "pandas/_libs/parsers.pyx", line 542, in pandas._libs.parsers.TextReader.cinit pandas.errors.EmptyDataError: No columns to parse from file

DuoCaiXie commented 2 years ago

hi,I also meet this error,can you tell me how do you fix it?

zhgqcn commented 2 years ago

1 ! python /content/seq2point-nilm/train_main.py

2021-10-28 09:11:45.132367: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA 2021-10-28 09:11:45.137674: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2299995000 Hz 2021-10-28 09:11:45.137931: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5628e544c840 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2021-10-28 09:11:45.137968: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version 2021-10-28 09:11:45.138216: I tensorflow/core/common_runtime/process_util.cc:147] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance. Importing training file... Traceback (most recent call last): File "/content/seq2point-nilm/train_main.py", line 32, in trainer.train_model() File "/content/seq2point-nilm/seq2point_train.py", line 112, in train_model training_history = self.default_train(model, callbacks, steps_per_training_epoch) File "/content/seq2point-nilm/seq2point_train.py", line 155, in default_train validation_steps=self.__validation_steps) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 66, in _method_wrapper return method(self, *args, kwargs) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 815, in fit model=self) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/keras/engine/data_adapter.py", line 1112, in init model=model) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/keras/engine/data_adapter.py", line 772, in init peek, x = self._peek_and_restore(x) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/keras/engine/data_adapter.py", line 830, in _peek_and_restore peek = next(x) File "/content/seq2point-nilm/data_feeder.py", line 88, in load_dataset self.check_if_chunking() File "/content/seq2point-nilm/data_feeder.py", line 63, in check_if_chunking skiprows=self.__skip_rows) File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 678, in parser_f return _read(filepath_or_buffer, kwds) File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 440, in _read parser = TextFileReader(filepath_or_buffer, kwds) File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 787, in init self._make_engine(self.engine) File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 1014, in _make_engine self._engine = CParserWrapper(self.f, self.options) File "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 1708, in init self._reader = parsers.TextReader(src, kwds) File "pandas/_libs/parsers.pyx", line 542, in pandas._libs.parsers.TextReader.cinit pandas.errors.EmptyDataError: No columns to parse from file

I have solved the problem, just set skiprows = 0 in pd.read_csv . Of course, you can set it to anyother number but don't larger than the number of rows that your .csv document has.

MingjunZhong commented 2 years ago

@zhgqcn Thanks - the code should be improved in that way.