TIBHannover / GeoEstimation

This repository contains all necessary meta information, results and source files to reproduce the results in the publication Eric Müller-Budack, Kader Pustu-Iren, Ralph Ewerth: "Geolocation Estimation of Photos using a Hierarchical Model and Scene Classification", In: European Conference on Computer Vision (ECCV), Munich, 2018.
https://labs.tib.eu/geoestimation
GNU General Public License v3.0
134 stars 32 forks source link

code can't work #15

Closed fzweclipse closed 2 years ago

fzweclipse commented 2 years ago

I use pytorch1.10.0, I can't run the code. train_base.py line21, self.hparam = hparams

torch.nn.nodules.nodule.py

error: in setattr object.setattr(self,name,value) AttributeError: Can't set attribute.

TIB-Visual-Analytics commented 2 years ago

Hi, we are using PyTorch 1.6 in our project. Please make sure that you use the correct versions of the libraries as indicated in the environment.yml.

The easiest way to run the code is to use conda, as described in the instructions

turicumoperarius commented 2 years ago

I encountered the same problem today. Because I wanted to run the code on more current versions of the dependencies I did have a small look into the "setattr" error. Its actually pretty simple to resolve, at least for inference.

Just replace the following line of code in classification/train_base.py in the "init" method of the MultiPartitioningClassifier Class and you should be good to go.

self.hparams = hparams ... to .... for key in hparams.keys(): self.hparams[key]=hparams[key]