centroids-reid
centroids-reid copied to clipboard
Running inference gives AttributeError: Missing attribute "MODEL
(centro) [user@remote centroids-reid]$ python inference/create_embeddings.py --config_file="configs/256_resnet50.yml" GPU_IDS [1] DATASETS.ROOT_DIR './test/probe/' TEST.IMS_PER_BATCH 128 OUTPUT_DIR './output-dir' TEST.ONLY_TEST True MODEL.PRETRAIN_PATH './logs/market1501/256_resnet50/train_ctl_model/version_0/auto_checkpoints/resnet50-19c8e357.pth'
INFO:main:Preparing data using <class 'inference_utils.ImageDataset'> dataset class ./test/probe/ 8 ['./test/probe/ursula.jpg', './test/probe/angela.jpg', './test/probe/charles.jpg', './test/probe/biden.jpg', './test/probe/Yoshi.jpg', './test/probe/justin.jpg', './test/probe/macron.jpg', './test/probe/boris.jpg'] Traceback (most recent call last): File "/home/user/anaconda3/envs/centro/lib/python3.7/site-packages/pytorch_lightning/utilities/parsing.py", line 184, in getattr return self[key] KeyError: 'MODEL'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "inference/create_embeddings.py", line 76, in
I can run the training but anytime I run any of the inference I receive this error.
That sounds very logical. I'm curious to check if the response from Amazon is causing this or if it is the XML to JSON that is causing this issue. It sounds like you are saying XML to JSON is the culprit. In any case, normalizing it sounds like a great idea. I probably won't get around to this soon. Feel free to submit a PR if you want it done soon.
On Thu, Nov 30, 2017 at 9:57 PM rmzg [email protected] wrote:
A problem I frequently run into is when the value of a given key somewhat randomly switches between an array value and an object value. In my most recent they key is the ItemLookupResponse.Items.Item which sometimes contains an array and sometimes contains a single object which tends to cause errors like TypeError: Cannot read property 'length' of undefined.
Obviously the reason why it switches is because sometimes there's multiple values and sometimes there's a single value, which is why you can't use a generic function to translate XML in to JSON since they're not the same type of structure.
This can be worked around in the requiring code with some annoyance but would make for much simpler code if it was fixed in the library code, which in this case means that Items.Item should always be an array.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dmcquay/node-apac/issues/91, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHIcS34oTn-SJAHji40e-R_V22Dx44Tks5s74c3gaJpZM4Qx3lM .
Obviously it's the xml2js
library doing it since you can't actually convert XML to JSON without throwing away a lot of the XML data. This is one of the most basic reasons to not use a generic converter.
It's not due to this option? `const xml2js = require('xml2js')
const defaultXml2JsOptions = { explicitArray: false }`
How can I change this just for test ?
Change what?
explicitArray: false to true