@@ -71,7 +71,7 @@ def __init__(self, config=None):
71
71
72
72
# Serve axon to enable external connections.
73
73
if not self .config .neuron .axon_off :
74
- self .axon = bt .axon (wallet = self .wallet , config = self .config )
74
+ self .axon = bt .axon (wallet = self .wallet , config = self .config , port = self . config . axon . port )
75
75
self ._serve_axon ()
76
76
77
77
else :
@@ -132,17 +132,17 @@ def set_weights(self):
132
132
133
133
# Calculate the average reward for each uid across non-zero values.
134
134
# Replace any NaN values with 0.
135
- raw_weights = torch .nn .functional .normalize (self .scores , p = 1 , dim = 0 )
135
+ raw_weights = torch .nn .functional .normalize (self .scores , p = 1 , dim = 0 ). to ( "cpu" ). numpy ()
136
136
137
137
logger .debug ("raw_weights" , raw_weights )
138
- logger .debug ("raw_weight_uids" , self .metagraph .uids . to ( "cpu" ) )
138
+ logger .debug ("raw_weight_uids" , self .metagraph .uids )
139
139
# Process the raw weights to final_weights via subtensor limitations.
140
140
(
141
141
processed_weight_uids ,
142
142
processed_weights ,
143
143
) = bt .utils .weight_utils .process_weights_for_netuid (
144
- uids = self .metagraph .uids . to ( "cpu" ) ,
145
- weights = raw_weights . to ( "cpu" ) ,
144
+ uids = self .metagraph .uids ,
145
+ weights = raw_weights ,
146
146
netuid = self .config .netuid ,
147
147
subtensor = self .subtensor ,
148
148
metagraph = self .metagraph ,
0 commit comments