gansformer icon indicating copy to clipboard operation
gansformer copied to clipboard

Generation of attention maps problem

Open Valquoniam opened this issue 1 year ago • 0 comments

Hey, I've been trying to generate attention maps, but I've been stuck with some errors.

Here is the way I used your codebase after cloning it :

  • Download cityscapes dataset : 'python prepare_data.py --cityscapes --max-images 100000'
  • Download pre-trained network for this dataset (and generating some images at the same time) : 'python generate.py --gpus 0 --model gdrive:cityscapes-snapshot.pkl --output-dir images --images-num 32'

Then I wanted to generate some attention maps : 'python run_network.py --gpus 0 --vis --pretrained-pkl cityscapes-snapshot.pkl --dataset cityscapes --vis-layer-maps'

At first, the code executed correctly, but no file was saved, there was only an empty 'layer_maps' folder. When forcing the parameter 'attention' to be True (visualise.py, l.72), I got this error :

visualize.py", line 170, in vis pallete = np.expand_dims(misc.get_colors(k - 1), axis = [2, 3]) numpy.AxisError: axis 3 is out of bounds for array of dimension 3

I don't know if I'm not using the codebase correctly or not, as a beginner.

Valquoniam avatar Jul 19 '23 15:07 Valquoniam