ai4co / rl4co

A PyTorch library for all things Reinforcement Learning (RL) for Combinatorial Optimization (CO)

Home Page:https://rl4.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]'key "demand" not found in TensorDict with keys [\'action_mask\', \'current_node\', \'done\', \'first_node\', \'i\', \'locs\', \'reward\', \'terminated\']'

1hhix opened this issue · comments

I encountered an issue in the file "rl4co-main\notebooks\tutorials\4-search-methods.ipynb," and it displayed "no demand."

env = TSPEnv(num_loc=50)
td = env.reset(batch_size=3).to(device)
out = policy(td, return_actions=True)

image

Hi @1hhix, sorry we are a bit late in answering.
Have you figured out the bug?
In that case, we checked and it was probably because the EAS model was trained on SDVRP (from here), but not on TSP, thus raising the "demand not found" error

Glad to hear that :) Don't hesitate to contact us if you find any issue~