quantize_model() cannot detect a keras.Sequential model
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- keras, python, tensorflow
- Ambito
- machine-learning
Direzione di ricerca
Inizia riproducendo il malfunzionamento segnalato con TensorFlow 2.17.0, TensorFlow Model Optimization 0.8.0 e il modello caricato da load_model(). Leggi il punto di ingresso quantize_model() e il relativo controllo dei modelli Sequential o Functional. Il lavoro è completo quando un modello keras.Sequential caricato da un file .keras viene accettato, con una copertura di regressione per il caso segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Prior to filing: check that this should be a bug instead of a feature request. Everything supported, including the compatible versions of TensorFlow, is listed in the overview page of each technique. For example, the overview page of quantization-aware training is here. An issue for anything not supported should be a feature request.
Describe the bug
I'm passing a keras sequential model into quantize_model(), and I'm getting the error that the model isn't a sequential model.
System information
Carried out in:
Google Colab
TensorFlow version (installed from source or binary):
2.17.0
TensorFlow Model Optimization version (installed from source or binary):
0.8.0
Python version:
3.10.12
Describe the expected behavior
prepare a keras sequential model built from scratch that was imported via load_model()
Describe the current behavior
ValueError: to_quantize can only either be a keras Sequential or Functional model.
Code to reproduce the issue
!pip install tensorflow_model_optimization
import pandas as pd
import numpy as np
import time
import tensorflow as tf
import os
import tempfile
import keras
import tensorflow_model_optimization as tfmot
from google.colab import drive
from tensorflow.keras.models import load_model
drive.mount('/content/drive')
%cd /content/drive/My Drive/CS528/HW3
model = load_model('/content/drive/My Drive/CS528/HW3/q1_model.keras')
quant_aware_model_tflite = '/content/drive/My Drive/CS528/HW3/s_mnist_quant_aware_training.tflite'
quantize_model = tfmot.quantization.keras.quantize_model
q_aware_model = quantize_model(model)
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
I've already checked the same compound conditional using the imported model just before calling quantize_model(), and it behaves as it should. Only when quantize_model() is actually handling the model does it seem to think the model isn't a tf.keras.Sequential object.
- Lingua principale
- Python
- Stelle
- 1.6k
- Fork
- 349
- Merge medio
- 3g 2h
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tensorflow/model-optimization
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
tensorflow/model-optimization#1301 · 1 commento ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
tensorflow/model-optimization#1272 ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
tensorflow/model-optimization#1270 · 2 commenti ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
tensorflow/model-optimization#1241 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
tensorflow/model-optimization#1182 · 1 commento ·
Tutte le issue di tensorflow/model-optimization
Issue simili
-
agent-ready documentation needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
instance instance add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
searxng/searx-instances#939 · 1 commento ·
-
area-deployment area-integrations triage:bot-seen
Difficoltà 2/5 Mezza giornata Idoneità per principianti 86/100