I’m trying to find a way to download a saved pytorch model hosted on Dropbox and load it into pytorch. I can’t save or write a file to the server that is running pytorch. I tried to download the torch model with the code below and got a attribute error. Any other ideas do load a model without writing to a file?
dropbox_url_act = "https://www.dropbox.com/path_here?&dl=1" dropbox_url_cri = "https://www.dropbox.com/path_here?&dl=1" req = requests.get(dropbox_url_act) actor = pickle.loads(req.content) req = requests.get(dropbox_url_cri) critic = pickle.loads(req.content) agent.actor_local.load_state_dict(torch.load(actor)) agent.critic_local.load_state_dict(torch.load(critic))
AttributeError : ‘int’ object has no attribute ‘seek’. You can only torch.load from a file that is seekable. Please pre-load the data into a buffer like io.BytesIO and try to load from it instead.