Skip to content
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

Error when trying to run the code #4

Open
fatimavrojas opened this issue Dec 28, 2021 · 1 comment
Open

Error when trying to run the code #4

fatimavrojas opened this issue Dec 28, 2021 · 1 comment
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@fatimavrojas
Copy link

fatimavrojas commented Dec 28, 2021

Hi there!, I´m tryng to run the code for the NYC data and getting this error:

--epochs 1 --device cpu --mode train
Train Epoch: 1 [2530/2531 Loss: 671.671570
Total training time: 23.70315432548523 seconds
Saving model to ./results/model_DG_new_york.pt ...
Computing the CPC on test set, loc2cpc_numerator ...
Traceback (most recent call last):
File "main.py", line 261, in
evaluate()
File "main.py", line 173, in evaluate
cpc_df = cpc_from_num(edf, oa2tile, o2d2flow)
File "main.py", line 166, in cpc_from_num
edf['tile'] = edf['locID'].apply(lambda x: oa2tile[x])
File "/home/fatima/.conda/envs/deepgravity/lib/python3.7/site-packages/pandas/core/series.py", line 4357, in apply
return SeriesApply(self, func, convert_dtype, args, kwargs).apply()
File "/home/fatima/.conda/envs/deepgravity/lib/python3.7/site-packages/pandas/core/apply.py", line 1043, in apply
return self.apply_standard()
File "/home/fatima/.conda/envs/deepgravity/lib/python3.7/site-packages/pandas/core/apply.py", line 1101, in apply_standard
convert=self.convert_dtype,
File "pandas/_libs/lib.pyx", line 2859, in pandas._libs.lib.map_infer
File "main.py", line 166, in
edf['tile'] = edf['locID'].apply(lambda x: oa2tile[x])
KeyError: 1

It seems the network is trained and saved properly, but something arise after it.
Thanks in advance,
Fatima.

@MassimilianoLuca
Copy link
Member

Dear fatimavrojas,
we have just pushed a new version of the code and we solved this problem. Please let us know if the problem persists

MassimilianoLuca added a commit that referenced this issue Dec 29, 2021
@MassimilianoLuca MassimilianoLuca self-assigned this Dec 29, 2021
@MassimilianoLuca MassimilianoLuca added bug Something isn't working help wanted Extra attention is needed labels Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants