New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't run baseline_rl.py #1
Comments
Hi @cihantugrulcicek, import os
base_dir = os.path.dirname(os.getcwd())
x_dir = os.path.join(base_dir, 'data', 'valid', 'instances')
adj_dir = os.path.join(base_dir, 'data', 'valid', 'adjs')
batch_env = BatchEnvRL(n_envs=2, from_file=True, x_dir=x_dir, adj_dir=adj_dir) Please let me know if this is working now. Thanks again for your feedback! |
it works now.. thank you for quick respond |
Dear Paulo,
Thanks for fixing the issue very quickly. I'd like to ask another question
related to problem definition. When running the code, if we decide to visit
a particular node in an instance and the tour time exceeds the closing time
of this node at the time of visit, i.e. after random noise is added,
'self.feas' variable is immediately set to 'False', and there is no way to
set it back to 'True', i.e., decision causes an infeasibility for the
instance. Is this due to problem definition? Imho, the only infeasibility
occurs if the tour time exceeds the maximum tour length, i.e. self.maxT,
because, even though a particular node doesn't yield a reward when visited
after its closing time, another node which would be visited after
traversing this particular node would still have a chance to yield reward
unless the maximum tour length is not exceeded. I'd appreciate it if you
clarify this issue for me. Thanks again.
Cihan
Paulo da Costa ***@***.***>, 14 May 2021 Cum, 14:12 tarihinde
şunu yazdı:
… Hi @cihantugrulcicek <https://github.com/cihantugrulcicek>,
Thanks for bringing this to our attention.
I have updated the code to read from_file=True when using the
''batch_env_rl''.
An example of how you can call it can be found below. Note that when
reading files with a different number of nodes, the instance features are
padded with zeros when the number of nodes is smaller than the maximum
number of nodes in the files.
import os
base_dir = os.path.dirname(os.getcwd())
x_dir = os.path.join(base_dir, 'data', 'valid', 'instances')
adj_dir = os.path.join(base_dir, 'data', 'valid', 'adjs')
batch_env = BatchEnvRL(n_envs=2, from_file=True, x_dir=x_dir, adj_dir=adj_dir)
Please let me know if this is working now.
Thanks again for your feedback!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALFWJAXI4E2F6RO6SEJYLQTTNUATFANCNFSM44ZOSWDQ>
.
|
Yes, our interpretation is that if you violate one of the time windows from above (you can still be early without any penalty) we deem the solution 'infeasible'. Cheers, Paulo |
I wasn't able to run the
baseline_rl.py
. When I run the code withfrom_file=True
, and providingx_dir
andadj_dir
,file not found error
for the adj file. I guess this occurs as adj files start withadj-
in the validation set. However, this is not specified inbatch_env_rl
.'ValueError: could not broadcast input array from shape (20,3) into shape (50,3)', which seems that the number of nodes are not read from file, instead, read
n_nodes
argument in the constructor.Sizes of tensors must match except in dimension 1. Got 32 and 1 in dimension 0 (The offending index is 1)
on line 54 in 'train_baseline.py'.The text was updated successfully, but these errors were encountered: