Comments (4)
@BeenKim do you have any examples of people using TCAV for TF/Keras object detection models?
from tcav.
Hi, to update my recent findings and issues.
Findings:
-
tracing back to the objectdetection class, I found out how to get the prediction layer of the SSD.
-
Also, I successfully recreate the loss function for this layer that works in the same fashion as KerasWrapper
Issues: -
I copy the KerasWrapper class to build a new KerasWrapperSSD (the SSD layer are Keras layers).
-
This class is also on model.py of the TCAV repository
-
I load the model as I did to found the model's layers, no error in that, except that the model seems not to load the backbone or any other layer. Hence I cannot extract the bottlenecks.
def import_keras_model(self, saved_path):
"""Loads keras model, fetching bottlenecks, inputs and outputs."""
self.ends = {}
PATH_TO_CFG=saved_path + "/pipeline.config"
PATH_TO_CKPT = saved_path + "/checkpoint"
configs = config_util.get_configs_from_pipeline_file(PATH_TO_CFG)
model_config = configs['model']
detection_model = model_builder.build(model_config=model_config, is_training=False)
ckpt = tf.compat.v2.train.Checkpoint(model=detection_model)
ckpt.restore(os.path.join(PATH_TO_CKPT, 'ckpt-0')).expect_partial()
self.model = detection_model
print(self.model)
print(self.model.feature_extractor.classification_backbone)
self.get_bottleneck_tensors()
self.get_inputs_and_outputs_and_ends()
self.get_image_shape()
- When I load model in this fashion on other script works, but as a class of TCAV, the model is just a simple shell
I don't know what is missing or what I'm doing wrong. I really, really appreciate any help. - Being more specific this the output for this command in the wrapper
print(self.model._feature_extractor.classification_backbone)
:
None
Bests
from tcav.
Hi, I try different setups of the wrapper but remain the same result. It seems that I cannot load an Object Detection model in this repository. Any help or guidance on why or how to solve this issue is welcome. I really appreciate any help you can provide.
from tcav.
Hi @emmanuelol , I'm a bit unclear on which part of TCAV that doesn't seem to work. You mentioned " Hence I cannot extract the bottlenecks." - what's the error msg you are getting?
I'll close this issue for now since it's been a while (perhaps you've solved it by now), but feel free to reopen if needed.
Been
from tcav.
Related Issues (20)
- Not able to run all the bottlenecks together for any given model HOT 2
- requirement.txt file has a mistake HOT 3
- How to use TCAV with custom keras models(h5) HOT 2
- why the 'get_direction_dir_sign' function returns 'dot_prod<0' instead 'dot_prod>0' ?? HOT 1
- Setup for Run_TCAV.ipynb fails HOT 2
- TCAV on tabular data HOT 3
- Random Images for TCAV for Diabetic Retinopathy application HOT 9
- Concept Images for TCAV for DR application
- Problem with Relative TCAV plots
- Question regarding discrete model prediction layer activation function and model loss function
- InvalidArgumentError: Requested return tensor 'softmax2_pre_activation:0' not found in graph def HOT 1
- result not reproduced by taking gradient wrt logit and flipping sign HOT 1
- Extend TCAV for Object detection
- TCAV for multiple instance learning
- Clarifying experiments in Section 4.1.2 Empirical Deep Dream
- InvalidArgumentError: Node 'v5/mul_1' is not unique
- Reproduce Fig.4. Zebra TCAV in googlenet from paper
- Downloading the tcav data using the download_and_make_datasets
- Columns and DataType Not Explicitly Set on line 69 of imagenet_and_broden_fetcher.py
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tcav.