GithubHelp home page GithubHelp logo

making-better-mistakes's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

making-better-mistakes's Issues

Error while training model with HXE loss

Hello,
I was trying to run the HXE experiments for tiered-ImageNet-H, and I got this error:

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [256, 12]], which is output 0 of SqueezeBackward0, is at version 1; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

Enabling anomaly detection, the error is shown in the following line in losses.py:
num[idx] = -torch.log(num[idx] / den[idx]).
In particular, the issue seems to be with num[idx] somehow is being considered an in-place operation which seems weird since all the other methods(DeViSE,Soft-labels, YOLOv2 and Barz&Denzler run smoothly).

It would be great if you could help me out with this issue.
Thanks!

Similar results obtained with Cross Entropy & HXE loss functions

Hi Fiveai team,

Hope you are doing well.

I'm creating this issue to request your help on the HXE loss performance. I'm performing an experiment for research on the Animal dataset with the HXE loss function provided in the making better mistakes paper. I used both ResNet18 and ResNet50 architecture, with pre-trained ImageNet weights and the same configurations specified in the paper on a custom animal dataset. With multiple configurations, I observed both Cross-Entropy and HXE have very similar results. The top-1 accuracy, recall, f1-score, and hdist mistakes follow the same patterns. Could you please suggest what could have been wrong here, while using this loss function on the custom dataset? Also, the HXE loss function considers all the nodes on the leaf level, but some classes could be non-leaf. I have a use case where one node is the parent of the other node, like genus-species, in such case distance between classes is different. How could we address this issue with the current implementation?

Looking forward to your reply.

Thanks,

Error in training tired-imagenet

Traceback (most recent call last):
File "scripts/start_training.py", line 349, in
main_worker(gpus_per_node, opts)
File "scripts/start_training.py", line 173, in main_worker
train_loader, model, loss_function, distances, soft_labels, classes, opts, epoch, steps, optimizer, is_inference=False, corrector=corrector,
File "making-better-mistakes/better_mistakes/model/run_xent.py", line 116, in run
topK_hdist[i, j] = distances[(classes[class_idx_predicted], classes[class_idx_ground_truth])]
IndexError: list index out of range

In the data_paths.yml:
I specify:
%----------------------------------------------
tiered-imagenet-224: /path/to/ImageNet/
%----------------------------------------------

It looks like tired-imagenet dataset needs other ways to prepare?

LCA Distances in the tiered_imagenet_ilsvrc_distances.txt.xz

Hello Authors,

I have used the tiered_imagenet_tree.pkl file to print the following tree. The lowest common ancestor of the leaf nodes n07831146 and n07836838 is n07829412 which is at distance 1. Whereas in the file tiered_imagenet_ilsvrc_distances.txt.xz you have shared, the LCA distance is 7. ( Please see 5th and 6th leaf nodes n07831146 and n07836838 in the tree).

Did you extend the tree to the finest level and then compute the LCA distances?
The extended tree meaning if the node at coarser-levels has no child nodes, you extend these nodes till the finest level and then compute the LCA distances?

Thank you so much!

Tree

Could the authors share the code to pre-compute the "*_ilsvrc_distances.pkl.xz" files?

I am not sure what are the distances stored in these files.
I tried to compute the shortest_path_length based on Imagenet hierarchy, but get similar but different numbers:

For example, in tiered_imagenet_ilsvrc_distances.pkl.xz:

key sotred_dist shortest_path_length
(n02090379,n02168699): 14 9
(n03125870,n04409515): 7 8
(n02395003,n02791124): 15 10
(n03803284,n04557648): 7 8
(n09468604,n01525720): 8 11
(n03347037,n03445924): 11 9
(n02489166,n02009912): 11 8
(n02480855,n07768694): 13 10
(n04127249,n02229544): 13 10
(n04552348,n02093859): 19 10
(n02808440,n03866082): 10 9
(n04401088,n01498041): 12 10
(n03146219,n04429376): 11 9
(n04049303,n02011460): 14 10
(n02692877,n02410509): 17 10
(n07590611,n02437616): 15 12
(n04579145,n02104523): 17 10
(n03980874,n03670208): 14 9
(n03457902,n03447447): 10 9
(n00002684,n07753113): 5 12
(n04202417,n04356056): 9 9
(n02279972,n02129165): 12 9
(n09421951,n07718747): 7 12
(n02089555,n02121808): 8 6
(n04347754,n03944341): 12 8
(n03614532,n02233338): 12 10
(n03414162,n03990474): 5 8
(n02093647,n02095412): 2 3
(n07714571,n02051845): 13 12
(n02028035,n07714990): 15 12
(n03891251,n04557648): 8 8
(n04311174,n04524313): 6 8
(n04208210,n02370806): 12 10
(n02089555,n01674464): 11 8
(n01482071,n02090622): 11 8
(n03614532,n07829412): 12 12
(n04550184,n01846331): 12 10
(n03419014,n02128925): 14 10
(n03146219,n07715103): 12 12
(n03928116,n04081281): 8 9
(n02091467,n07695965): 18 12
(n04347754,n02087122): 18 10
(n04550184,n04326547): 8 9
(n02951358,n03942813): 11 8
(n02526121,n04515003): 14 10
(n03930630,n02099712): 21 10
(n04479046,n02865351): 5 6
(n02028035,n01676755): 10 8
(n02704792,n04507155): 11 9
(n02536864,n02933112): 12 10

what's the meaning of "bd" in "inaturalist19_bd_embeddings.pkl" file?

This work means a lot to me, thank you for sharing this interesting work. I have come across some files named as xxxxx_bd_embeddings.pkl in data folders, and I'm curious about their meaning. Specifically, what does the abbreviation 'bd' stand for in these filenames? Upon reading the files, I found they contain dictionaries that appear to be measuring relationships between categories. Could you please explain the specific meaning of these values? Looking forward to your response.

Authors, please share the code for pre-computing distances!

Hi @rhomu , Thanks for the great repository!

It could be very kind of you to provide me with the code to compute the distances in tiered_imagenet_ilsvrc_distances.pkl.xz,.

Also, I am unclear on how to generate the file for tiered_imagenet_tree.pkl, and tiered_imagenet_isa. If possible, please include the scripts to generate these files too.

My Email ID is: [email protected]

Thanks again!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.