You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AttributeError: 'Timedelta' object has no attribute 'delta' #16
That problem is solved by modifying the function to this " def datetime_encoded(self, units):
units = ensure_list(units)
# mapping = {un: pd.to_timedelta('1' + un).delta
# for un in ['day', 'hour', 'minute', 'second',
# 'millisecond', 'microsecond', 'nanosecond']}
mapping = {
'day': pd.to_timedelta('1d').value,
'hour': pd.to_timedelta('1h').value,
'minute': pd.to_timedelta('1m').value,
'second': pd.to_timedelta('1s').value,
'millisecond': pd.to_timedelta('1ms').value,
'microsecond': pd.to_timedelta('1us').value,
'nanosecond': pd.to_timedelta('1ns').value
}
# mapping['week'] = pd.to_timedelta('1W').delta
mapping['week'] = pd.to_timedelta('1W').value
mapping['year'] = 365.2425 * 24 * 60 * 60 * 10 ** 9
index_nano = self.index.view(np.int64)
datetime = dict()
for unit in units:
if unit not in mapping:
raise ValueError()
nano_sec = index_nano * (2 * np.pi / mapping[unit])
datetime[unit + '_sin'] = np.sin(nano_sec)
datetime[unit + '_cos'] = np.cos(nano_sec)
return pd.DataFrame(datetime, index=self.index, dtype=np.float32)"
Not sure if it will work, It runs without any error though.
@NonCover Did you manage to run this model? I tried to Run it following my solution, I get gpu memory over utilization error. I have 24 GB GPU. How much memory does it need?
@NonCover Did you manage to run this model? I tried to Run it following my solution, I get gpu memory over utilization error. I have 24 GB GPU. How much memory does it need?
Logically speaking, using PL to run your model will optimize the space. There is a significant difference in memory usage when I run my model with PL and without it.
@NonCover Also Can you share your requirement files?
Perhaps my configuration file won't work for you, because I've modified a lot of the source code of tsl.
I confirm that a pandas version < 1.4 fixes this problem. However, a versioned requirements file for this package - including all the dependencies - would be difficult to produce now.
We integrated SPIN in Torch Spatiotemporal from version 0.9.5. We suggest you use this implementation within tsl to solve all dependencies directly.
As also written in the paper, the original SPIN model may require high GPU memory. You can opt for the hierarchical version, which is more scalable with minimal sacrifice in accuracy.
Activity
Mr-Nobody-dey commentedon Dec 31, 2024
did you get any solution?
The problem is in the tsl module. I have raised a issue their also. Hopefully I will get a response their.
Mr-Nobody-dey commentedon Dec 31, 2024
That problem is solved by modifying the function to this " def datetime_encoded(self, units):
units = ensure_list(units)
# mapping = {un: pd.to_timedelta('1' + un).delta
# for un in ['day', 'hour', 'minute', 'second',
# 'millisecond', 'microsecond', 'nanosecond']}
mapping = {
'day': pd.to_timedelta('1d').value,
'hour': pd.to_timedelta('1h').value,
'minute': pd.to_timedelta('1m').value,
'second': pd.to_timedelta('1s').value,
'millisecond': pd.to_timedelta('1ms').value,
'microsecond': pd.to_timedelta('1us').value,
'nanosecond': pd.to_timedelta('1ns').value
}
Not sure if it will work, It runs without any error though.
NonCover commentedon Dec 31, 2024
Thanks for your reply very much! I found that pandas` version is 2.x.x, so I re-installed pandas v1.3.5, and then everything is okay.
Mr-Nobody-dey commentedon Jan 1, 2025
@NonCover Did you manage to run this model? I tried to Run it following my solution, I get gpu memory over utilization error. I have 24 GB GPU. How much memory does it need?
Mr-Nobody-dey commentedon Jan 1, 2025
@NonCover Also Can you share your requirement files?
NonCover commentedon Jan 2, 2025
Logically speaking, using PL to run your model will optimize the space. There is a significant difference in memory usage when I run my model with PL and without it.
Perhaps my configuration file won't work for you, because I've modified a lot of the source code of tsl.
marshka commentedon Jan 2, 2025
I confirm that a pandas version < 1.4 fixes this problem. However, a versioned requirements file for this package - including all the dependencies - would be difficult to produce now.
We integrated SPIN in Torch Spatiotemporal from version 0.9.5. We suggest you use this implementation within tsl to solve all dependencies directly.
As also written in the paper, the original SPIN model may require high GPU memory. You can opt for the hierarchical version, which is more scalable with minimal sacrifice in accuracy.
Mr-Nobody-dey commentedon Jan 3, 2025
Thanks for your reply. Will look into it.