facebookresearch / pytorch_GAN_zoo

A mix of GAN implementations including progressive growing
BSD 3-Clause "New" or "Revised" License
1.62k stars 271 forks source link

The form of the .json file about "pathAttribDict(string):" is false. #88

Open yangzhikai opened 5 years ago

yangzhikai commented 5 years ago

A false form about .json file, mentioned in "pathAttribDict(string):" They should be : { "number1.jpg": {"attribute1": 1, "attribute2": 2, ...} "numbe2r.jpg": {"attribute1": 1, "attribute2": 2, ...} }

yangzhikai commented 5 years ago

when I set the json file as: { "number1.jpg": {"attribute1": 1, "attribute2": 2}, "number2.jpg": {"attribute1": 12, "attribute2": 22}, "number3.jpg": {"attribute1": 13, "attribute2": 23}, "number4.jpg": {"attribute1": 14, "attribute2": 24} } I run the function "loadAttribDict" in attrib_dataset.py a disordered variable "shiftAttribVal" is produced: {'maxIterAtScale': {1: 0, 12: 1, 13: 2, 14: 3}, 'maxIterAtScale0': {2: 1, 22: 2, 23: 3, 24: 0}}

I fund a wrong has happend in " for attribName, attribVals in attribList.items(): " sence 'attribVals' become to be {1, 12, 13, 14} and {24, 2, 22, 23}. Unitl I have changaed 'attribList[attribName] = set() ' as attribList[attribName] = list()
and next rogram command 'attribList[attribName].add(attribVal)' as 'add(attribVal)'
in "def loadAttribDict" ,the disorder has been solved.

I think you should discribe the attribution json file in more detail.