Tensorflow model can't be dumped directly. So the data should be save separately **TODO**: Please implement the function to load the files Parameters ---------- path : Union[Path, str] the target path to be dumped
(self, path: Union[Path, str])
| 294 | pass |
| 295 | |
| 296 | def to_pickle(self, path: Union[Path, str]): |
| 297 | """ |
| 298 | Tensorflow model can't be dumped directly. |
| 299 | So the data should be save separately |
| 300 | |
| 301 | **TODO**: Please implement the function to load the files |
| 302 | |
| 303 | Parameters |
| 304 | ---------- |
| 305 | path : Union[Path, str] |
| 306 | the target path to be dumped |
| 307 | """ |
| 308 | # FIXME: implementing saving tensorflow models |
| 309 | # save tensorflow model |
| 310 | # path = Path(path) |
| 311 | # path.mkdir(parents=True) |
| 312 | # self.model.save(path) |
| 313 | |
| 314 | # save qlib model wrapper |
| 315 | drop_attrs = ["model", "tf_graph", "sess", "data_formatter"] |
| 316 | orig_attr = {} |
| 317 | for attr in drop_attrs: |
| 318 | orig_attr[attr] = getattr(self, attr) |
| 319 | setattr(self, attr, None) |
| 320 | super(TFTModel, self).to_pickle(path) |
| 321 | for attr in drop_attrs: |
| 322 | setattr(self, attr, orig_attr[attr]) |
no outgoing calls
no test coverage detected