tweaks, try live trading
This commit is contained in:
@ -229,9 +229,12 @@ class TrainingIntegration:
|
||||
# Truncate
|
||||
features = features[:50]
|
||||
|
||||
# Get the model's device to ensure tensors are on the same device
|
||||
model_device = next(cnn_model.parameters()).device
|
||||
|
||||
# Create tensors
|
||||
features_tensor = torch.FloatTensor(features).unsqueeze(0).to(device)
|
||||
target_tensor = torch.LongTensor([target]).to(device)
|
||||
features_tensor = torch.FloatTensor(features).unsqueeze(0).to(model_device)
|
||||
target_tensor = torch.LongTensor([target]).to(model_device)
|
||||
|
||||
# Training step
|
||||
cnn_model.train()
|
||||
|
Reference in New Issue
Block a user