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

fail to run the colab file and demo #15

Open
yejy53 opened this issue Jul 28, 2023 · 3 comments
Open

fail to run the colab file and demo #15

yejy53 opened this issue Jul 28, 2023 · 3 comments

Comments

@yejy53
Copy link

yejy53 commented Jul 28, 2023

  1. Why did I fail to run the colab file you provided directly?

UnpicklingError Traceback (most recent call last)
in <cell line: 22>()
20 # but num_rotations=64~128 is often sufficient.
21 # To reduce the memory usage, we can reduce the tile size in the next cell.
---> 22 demo = Demo(num_rotations=256, device='cpu') # change to "cuda" if you have a GPU.

2 frames
/usr/local/lib/python3.10/dist-packages/torch/serialization.py in _legacy_load(f, map_location, pickle_module, **pickle_load_args)
1031 "functionality.")
1032
-> 1033 magic_number = pickle_module.load(f, **pickle_load_args)
1034 if magic_number != MAGIC_NUMBER:
1035 raise RuntimeError("Invalid magic number; corrupt file?")

UnpicklingError: invalid load key, '<'.

2、Unable to run download osm smoothly

MaxRetryError: HTTPSConnectionPool(host='api.openstreetmap.org', port=443): Max retries exceeded with url: /api/0.6/map.json?bbox=8.548173412781503%2C47.37771879777533%2C8.55013322635351%2C47.37904999377059 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000293A557CEB0>, 'Connection to api.openstreetmap.org timed out. (connect timeout=10)'))

@sarlinpe
Copy link
Collaborator

  1. Can you report the full traceback? There's likely some intermediate scopes missing. Is there an error message related to downloading the model? can you try again on a fresh runtime?
  2. The link works fine on my end. Is this in colab? if not you might be connected from IP that spams OSM and your requests are thus limited.

@yejy53
Copy link
Author

yejy53 commented Jul 28, 2023

  1. I tried a new runtime, but it still failed. It was able to run before. I don't know why it can't work today?

/content/OrienterNet
Preparing metadata (setup.py)... done


UnpicklingError Traceback (most recent call last)
in <cell line: 22>()
20 # but num_rotations=64~128 is often sufficient.
21 # To reduce the memory usage, we can reduce the tile size in the next cell.
---> 22 demo = Demo(num_rotations=256, device='cpu') # change to "cuda" if you have a GPU.

2 frames
/content/OrienterNet/maploc/demo.py in init(self, experiment_or_path, device, **kwargs)
132 experiment_or_path, _ = pretrained_models[experiment_or_path]
133 path = resolve_checkpoint_path(experiment_or_path)
--> 134 ckpt = torch. load(path, map_location=(lambda storage, loc: storage))
135 config = ckpt["hyper_parameters"]
136 config.model.update(kwargs)

/usr/local/lib/python3.10/dist-packages/torch/serialization.py in load(f, map_location, pickle_module, weights_only, **pickle_load_args)
813 except RuntimeError as e:
814 raise pickle.UnpicklingError(UNSAFE_MESSAGE + str(e)) from None
--> 815 return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
816
817

/usr/local/lib/python3.10/dist-packages/torch/serialization.py in _legacy_load(f, map_location, pickle_module, **pickle_load_args)
1031 "functionality.")
1032
-> 1033 magic_number = pickle_module.load(f, **pickle_load_args)
1034 if magic_number != MAGIC_NUMBER:
1035 raise RuntimeError("Invalid magic number; corrupt file?")

UnpicklingError: invalid load key, '<'.

  1. I tried to run the following code successfully, but I couldn't run the code in the demo:
    import requests
    import time

OSM_URL = "https://api.openstreetmap.org/api/0.6/map.json"

start_time = time. time()
response = requests. get(OSM_URL)
end_time = time. time()

print(f"The request took {end_time - start_time} seconds.")

The request took 0.9423749446868896 seconds.

@yejy53
Copy link
Author

yejy53 commented Jul 29, 2023

  1. Great, today's colab running demo is successful! Thanks to the author!
  2. But the problem of OSM download is still unsolvable. I can succeed on colab, but not in the local demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants