GithubHelp home page GithubHelp logo

ankitdhall / learning_embeddings Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 7.0 2.6 MB

Code for CVPR-W 2020 paper "Hierarchical Image Classification using Entailment Cone Embeddings" https://arxiv.org/abs/2004.03459

Home Page: https://ankitdhall.github.io/project/learning-representations-for-images-with-hierarchical-labels/

Python 81.77% HTML 18.23%
cvpr-2020 image-classification representation-learning hyperbolic-embeddings non-euclidean-geometry fine-grained-classification

learning_embeddings's People

Contributors

ankitdhall avatar

Stargazers

 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

learning_embeddings's Issues

git.exc.InvalidGitRepositoryError

Hi, @ankitdhall
how to fix the bug?

python network/ethec_experiments.py --experiment_name exp_test --experiment_dir exp --image_dir ETHEC_dataset_v0.1/ETHEC_dataset/IMAGO_build_test_resized/ --n_epochs 1 --model resnet18 --loss multi_level --set_mode train
PyTorch Version: 2.1.0+cpu
Torchvision Version: 0.16.0+cpu
Traceback (most recent call last):
File "network/ethec_experiments.py", line 466, in
ETHEC_train_model(args)
File "network/ethec_experiments.py", line 247, in ETHEC_train_model
repo = git.Repo(search_parent_directories=True)
File "C:\Users\omnisky.conda\envs\learning_embeddings\lib\site-packages\git\repo\base.py", line 267, in init
raise InvalidGitRepositoryError(epath)
git.exc.InvalidGitRepositoryError: E:\learning_embeddings

About the usage of CIFAR10 dataset in the code repo

Greetings,
I notice in the ethec_experiments.py of the Adam1X branch, both ETHECExperiment() and ETHEC2D() need a CIFAR10 object. May I ask what is CIFAR10 used here? If the aiming dataset is ETHEC1.0, why do we still need to define the label map of CIFAR10?
Sincerely thanks for any possible response.

KeyError: 'mannii'

When running

--experiment_name
test1
--experiment_dir
test1_dir
--image_dir
<path_to>/ETHEC_dataset_v0.2/ETHEC_dataset/IMAGO_build_test_resized
--n_epochs
10
--model
resnet50
--loss
multi_level
--set_mode
train 

it crashes with:

Traceback (most recent call last):
  File "learning_embeddings/network/ethec_experiments.py", line 473, in <module>
    ETHEC_train_model(args)
  File "learning_embeddings/network/ethec_experiments.py", line 361, in ETHEC_train_model
    sampler=None if arguments.class_weights else WeightedResampler(
  File "learning_embeddings/network/experiment.py", line 231, in __init__
    label_ids = [dataset[ind]['leaf_label'] for ind in range(len(dataset))]
  File "learning_embeddings/network/experiment.py", line 231, in <listcomp>
    label_ids = [dataset[ind]['leaf_label'] for ind in range(len(dataset))]
  File "learning_embeddings/data/db.py", line 3789, in __getitem__
    'labels': torch.from_numpy(self.labelmap.get_one_hot(sample['family'], sample['subfamily'], sample['genus'],
  File "learning_embeddings/data/db.py", line 1071, in get_one_hot
    retval[self.genus_specific_epithet[specific_epithet] + self.levels[0] + self.levels[1] + self.levels[2]] = 1
KeyError: 'mannii'

What am i doing wrong ?

Train,Test,Val json file

Can you share the exact train, test, val json files that you used . The ones with the dataset seems to be incompatible with the code.

Issues while running the code

There are still few issues in the code:

  1. The split that are given are sort of corrupt as there are many images that have image name in the 'image_path' and 'image_path' as empty.
  2. After this, while running ethec_experiments.py , the train set and everything is made by db.py, so if labelmap = ETHECLabelMap, then there are 550 specific_epithets and 560 genus_specific_epithet. So, the issue comes is that the train set and the labeling of the last level is done with the help of specific epithets but decode_children that is used while training, decode the last level label by using genus_specific_epithet.
  3. If oder_embeddings.py is run then the first issue is ETHECDB doesnot take input with_images, if that is resolved, the training is stucked after the first epoch.

Please see for these issues and make the code easily reproducible

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.