fix import and some error
This commit is contained in:
+4
-2
@@ -1,6 +1,7 @@
|
||||
from tugo.agents.base import Agent
|
||||
from tugo.agents.helpers import is_point_an_eye
|
||||
from game_logic import goboard
|
||||
# from game_logic import goboard
|
||||
from tugo.game_logic import goboard_fast as goboard
|
||||
from tugo.models import AlphaGoModel
|
||||
|
||||
import numpy as np
|
||||
@@ -44,6 +45,7 @@ class DeepLearningAgent(Agent):
|
||||
@classmethod
|
||||
def load(cls, file_path, encoder):
|
||||
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
||||
model = AlphaGoModel(encoder.get_input_shape(), is_policy_net=True).to(device)
|
||||
# model = AlphaGoModel(encoder.get_input_shape(), is_policy_net=True).to(device)
|
||||
model = AlphaGoModel(encoder.shape(), is_policy_net=True, num_classes=361).to(device)
|
||||
model.load_state_dict(torch.load(file_path))
|
||||
return cls(model, encoder)
|
||||
|
||||
Reference in New Issue
Block a user