Open DA21S321D opened 6 months ago
Also, the RL method shape is different, how can i run it on NewYork map?
Please try this function:
def build_network_from_copy_only_weight(self, network, network_copy):
"""Initialize a Q network from a copy"""
network_weights = network_copy.get_weights()
network.set_weights(network_weights)
network.compile(optimizer=Adam(lr=self.dic_agent_conf["LEARNING_RATE"]),
loss=self.dic_agent_conf["LOSS_FUNCTION"])
return network
Thanks, with your help i successfully load model trained on jinan and then deploy it on newyork map. Advancedcolight, EfficientColight and Colight are fine, but MPlight seems to be different. How can i make jinan model trained by MPlight run on newyork map?
This is the error, i have no idea how to handle this:
MPLight can be directly loaded by load_network(*)
, a function from ./models/network_agent.py
.
def load_network(self, file_name, file_path=None):
if file_path is None:
file_path = self.dic_path["PATH_TO_MODEL"]
self.q_network = load_model(os.path.join(file_path, "%s.h5" % file_name), custom_objects={"Selector": Selector})
print("succeed in loading model %s" % file_name)
I modified the path of the pretrained MPlight model in this line (modified here) to load the network. And then i run the run_mplight like this:python run_mplight.py--dataset newyork_28x7 --traffic_file anon_28_7_newyork_real_double.json --proj_name Scalability
. And when this script run into model_test. It occurs this problem again:
Am i doing wrong in some percedure?
Sorry, I haven't encountered your problem before. You may need to use the debug mode to locate the exact problem.
When i use the model trained on map jinan 1 anon_3_4_jinan_real.json to do transferability test on map hangzhou 1 anon_4_4_hangzhou_real.json shown in your paper i met this problem: