This is my first time writing an Issue, so there may be some poor parts.
System information
Have I written custom code (as opposed to using example directory):I used custom code where the ohlcv is generated.
OS Platform and Distribution (e.g. Mac Sierra, Windows 10, Linux Ubuntu 16.04): Windows10
TensorTrade version: latest
TensorFlow version: Not relevant to the issue.
Python version: 3.8.10
Describe the current behavior
The problem occurred when I was working on the Renderers and Plotly Chart in Example.
When I ran agent.train, I got an Invalid format string error at the ScreenLogger Class, as shown below.
This error was caused by incorrect formatting, so I fixed it and the error went away.
File \tensortrade\env\default\renderers.py:218, in ScreenLogger.render_env(self, episode, max_episodes, step, max_steps, price_history, net_worth, performance, trades)
209 def render_env(self,
210 episode: int = None,
211 max_episodes: int = None,
(...)
216 performance: pd.DataFrame = None,
217 trades: 'OrderedDict' = None):
--> 218 print(self._create_log_entry(episode, max_episodes, step, max_steps, date_format=self._date_format))
File \tensortrade\env\default\renderers.py:109, in BaseRenderer._create_log_entry(episode, max_episodes, step, max_steps, date_format)
82 @staticmethod
83 def _create_log_entry(episode: int = None,
84 max_episodes: int = None,
85 step: int = None,
86 max_steps: int = None,
87 date_format: str = "%Y-%m-%d %H:%M:%S %p") -> str:
88 """
89 Creates a log entry to be used by a renderer.
90
(...)
107 a log entry
108 """
--> 109 log_entry = f"[{datetime.now().strftime(date_format)}]"
111 if episode is not None:
112 log_entry += f" Episode: {episode + 1}/{max_episodes if max_episodes else ''}"
ValueError: Invalid format string
Describe the expected behavior
Changed the date_format of the Init method of the ScreenLogger Class as follows.
Other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
This is my first time writing an Issue, so there may be some poor parts.
System information
Describe the current behavior The problem occurred when I was working on the Renderers and Plotly Chart in Example. When I ran agent.train, I got an Invalid format string error at the ScreenLogger Class, as shown below. This error was caused by incorrect formatting, so I fixed it and the error went away.
Describe the expected behavior Changed the date_format of the Init method of the ScreenLogger Class as follows.
Code to reproduce the issue
I used the data generated by the following for df.
Other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.