{"action":"created","issue":{"url":"https://api.github.com/repos/nilmtk/nilmtk/issues/670","repository_url":"https://api.github.com/repos/nilmtk/nilmtk","labels_url":"https://api.github.com/repos/nilmtk/nilmtk/issues/670/labels{/name}","comments_url":"https://api.github.com/repos/nilmtk/nilmtk/issues/670/comments","events_url":"https://api.github.com/repos/nilmtk/nilmtk/issues/670/events","html_url":"https://github.com/nilmtk/nilmtk/issues/670","id":323047499,"number":670,"title":"UnicodeDecodeError when loading metadata","user":{"login":"nilmtkhelp","id":39287831,"avatar_url":"https://avatars0.githubusercontent.com/u/39287831?v=4","gravatar_id":"","url":"https://api.github.com/users/nilmtkhelp","html_url":"https://github.com/nilmtkhelp","followers_url":"https://api.github.com/users/nilmtkhelp/followers","following_url":"https://api.github.com/users/nilmtkhelp/following{/other_user}","gists_url":"https://api.github.com/users/nilmtkhelp/gists{/gist_id}","starred_url":"https://api.github.com/users/nilmtkhelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilmtkhelp/subscriptions","organizations_url":"https://api.github.com/users/nilmtkhelp/orgs","repos_url":"https://api.github.com/users/nilmtkhelp/repos","events_url":"https://api.github.com/users/nilmtkhelp/events{/privacy}","received_events_url":"https://api.github.com/users/nilmtkhelp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-15T02:46:09Z","updated_at":"2018-05-20T14:18:10Z","closed_at":null,"author_association":"NONE","body":"when I convert REDD data to ~.h5, I meet this below error.\r\n\r\nhelp me!\r\n\r\nfrom nilmtk.dataset_converters import convert_redd\r\nconvert_redd(\"C:\\\\Users\\\\Administrator\\\\REDD\\\\low_freq\\\\low_freq\",\"C:\\\\Users\\\\Administrator\\\\REDD\\\\low_freq\\\\low_freq\\\\redd.h5\")\r\n\r\nLoading house 1... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \r\nLoading house 2... 1 2 3 4 5 6 7 8 9 10 11 \r\nLoading house 3... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 \r\nLoading house 4... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \r\nLoading house 5... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 \r\nLoading house 6... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 \r\nLoaded metadata\r\n---------------------------------------------------------------------------\r\nUnicodeDecodeError                        Traceback (most recent call last)\r\n<ipython-input-3-128966c30980> in <module>()\r\n      1 from nilmtk.dataset_converters import convert_redd\r\n----> 2 convert_redd(\"C:\\\\Users\\\\Administrator\\\\REDD\\\\low_freq\\\\low_freq\",\"C:\\\\Users\\\\Administrator\\\\REDD\\\\low_freq\\\\low_freq\\\\redd.h5\")\r\n      3 #convert_redd(\"I:\\\\전력 데이터\\\\REDD\\\\low_freq\\\\low_frequ\",\"I:\\\\전력 데이터\\\\REDD\\\\low_freq\\\\redd.h5\")\r\n\r\nc:\\users\\administrator\\nilmtk\\nilmtk\\dataset_converters\\redd\\convert_redd.py in convert_redd(redd_path, output_filename, format)\r\n     55                               'redd',\r\n     56                               'metadata'),\r\n---> 57                          store)\r\n     58     store.close()\r\n     59 \r\n\r\nc:\\users\\administrator\\nilm_metadata\\nilm_metadata\\convert_yaml_to_hdf5.py in save_yaml_to_datastore(yaml_dir, store)\r\n     77     metadata = _load_file(yaml_dir, 'dataset.yaml')\r\n     78     print(\"Loaded metadata\")\r\n---> 79     meter_devices = _load_file(yaml_dir, 'meter_devices.yaml')\r\n     80     metadata['meter_devices'] = meter_devices\r\n     81     store.save_metadata('/', metadata)\r\n\r\nc:\\users\\administrator\\nilm_metadata\\nilm_metadata\\convert_yaml_to_hdf5.py in _load_file(yaml_dir, yaml_filename)\r\n    104     if isfile(yaml_full_filename):\r\n    105         with open(yaml_full_filename) as fh:\r\n--> 106             return yaml.load(fh)\r\n    107     else:\r\n    108         print(yaml_full_filename, \"not found.\", file=stderr)\r\n\r\n~\\Anaconda3\\lib\\site-packages\\yaml\\__init__.py in load(stream, Loader)\r\n     68     and produce the corresponding Python object.\r\n     69     \"\"\"\r\n---> 70     loader = Loader(stream)\r\n     71     try:\r\n     72         return loader.get_single_data()\r\n\r\n~\\Anaconda3\\lib\\site-packages\\yaml\\loader.py in __init__(self, stream)\r\n     32 \r\n     33     def __init__(self, stream):\r\n---> 34         Reader.__init__(self, stream)\r\n     35         Scanner.__init__(self)\r\n     36         Parser.__init__(self)\r\n\r\n~\\Anaconda3\\lib\\site-packages\\yaml\\reader.py in __init__(self, stream)\r\n     83             self.eof = False\r\n     84             self.raw_buffer = None\r\n---> 85             self.determine_encoding()\r\n     86 \r\n     87     def peek(self, index=0):\r\n\r\n~\\Anaconda3\\lib\\site-packages\\yaml\\reader.py in determine_encoding(self)\r\n    122     def determine_encoding(self):\r\n    123         while not self.eof and (self.raw_buffer is None or len(self.raw_buffer) < 2):\r\n--> 124             self.update_raw()\r\n    125         if isinstance(self.raw_buffer, bytes):\r\n    126             if self.raw_buffer.startswith(codecs.BOM_UTF16_LE):\r\n\r\n~\\Anaconda3\\lib\\site-packages\\yaml\\reader.py in update_raw(self, size)\r\n    176 \r\n    177     def update_raw(self, size=4096):\r\n--> 178         data = self.stream.read(size)\r\n    179         if self.raw_buffer is None:\r\n    180             self.raw_buffer = data\r\n\r\nUnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 1591: illegal multibyte sequence\r\n"},"comment":{"url":"https://api.github.com/repos/nilmtk/nilmtk/issues/comments/390486200","html_url":"https://github.com/nilmtk/nilmtk/issues/670#issuecomment-390486200","issue_url":"https://api.github.com/repos/nilmtk/nilmtk/issues/670","id":390486200,"user":{"login":"nipunbatra","id":60985,"avatar_url":"https://avatars2.githubusercontent.com/u/60985?v=4","gravatar_id":"","url":"https://api.github.com/users/nipunbatra","html_url":"https://github.com/nipunbatra","followers_url":"https://api.github.com/users/nipunbatra/followers","following_url":"https://api.github.com/users/nipunbatra/following{/other_user}","gists_url":"https://api.github.com/users/nipunbatra/gists{/gist_id}","starred_url":"https://api.github.com/users/nipunbatra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nipunbatra/subscriptions","organizations_url":"https://api.github.com/users/nipunbatra/orgs","repos_url":"https://api.github.com/users/nipunbatra/repos","events_url":"https://api.github.com/users/nipunbatra/events{/privacy}","received_events_url":"https://api.github.com/users/nipunbatra/received_events","type":"User","site_admin":false},"created_at":"2018-05-20T14:18:10Z","updated_at":"2018-05-20T14:18:10Z","author_association":"MEMBER","body":"@nilmtkhelp This seems like a Python 3 encoding issue to me.\r\n\r\nhttps://stackoverflow.com/a/20994462/743775\r\n\r\nPinging @PMeira "}}
{"actor":{"display_login":"nipunbatra"}}