Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Error API Cloud Video Intelligence - Requested model could not be loaded

Ouverte
#10,733 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
28/100
Type d'issue
Documentation
Clarté
À clarifier
Activité
À l'abandon
Stack technique
python
Domaine
cloud, documentation

Piste de recherche

Commencez par test.py et la documentation liée sur la classification vidéo en streaming de Video Intelligence, puis examinez l’exemple de StreamingVideoIntelligenceServiceClient et sa configuration de modèle. Reproduisez la réponse « Requested model could not be loaded » et vérifiez les exigences documentées pour le modèle AutoML et l’endpoint. Le travail est terminé lorsque l’exemple et la documentation indiquent clairement la configuration requise ou corrigent l’utilisation présentée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

api: videointelligence priority: p2 samples type: bug

In which file did you encounter the issue?

import io

from google.cloud import videointelligence_v1p3beta1 as videointelligence

# path = 'path_to_file'
# project_id = 'gcp_project_id'
# model_id = 'automl_classification_model_id'

client = videointelligence.StreamingVideoIntelligenceServiceClient()

model_path = "projects/{}/locations/us-central1/models/{}".format(
    project_id, model_id
)

# Here we use classification as an example.
automl_config = videointelligence.StreamingAutomlClassificationConfig(
    model_name=model_path
)

video_config = videointelligence.StreamingVideoConfig(
    feature=videointelligence.StreamingFeature.STREAMING_AUTOML_CLASSIFICATION,
    automl_classification_config=automl_config,
)

# config_request should be the first in the stream of requests.
config_request = videointelligence.StreamingAnnotateVideoRequest(
    video_config=video_config
)

# Set the chunk size to 5MB (recommended less than 10MB).
chunk_size = 5 * 1024 * 1024

# Load file content.
# Note: Input videos must have supported video codecs. See
# https://cloud.google.com/video-intelligence/docs/streaming/streaming#supported_video_codecs
# for more details.
stream = []
with io.open(path, "rb") as video_file:
    while True:
        data = video_file.read(chunk_size)
        if not data:
            break
        stream.append(data)

def stream_generator():
    yield config_request
    for chunk in stream:
        yield videointelligence.StreamingAnnotateVideoRequest(input_content=chunk)

requests = stream_generator()

# streaming_annotate_video returns a generator.
# The default timeout is about 300 seconds.
# To process longer videos it should be set to
# larger than the length (in seconds) of the stream.
responses = client.streaming_annotate_video(requests, timeout=600)

for response in responses:
    # Check for errors.
    if response.error.message:
        print(response.error.message)
        break

    for label in response.annotation_results.label_annotations:
        for frame in label.frames:
            print(
                "At {:3d}s segment, {:5.1%} {}".format(
                    frame.time_offset.seconds,
                    frame.confidence,
                    label.entity.entity_id,
                )
            )

Describe the issue

https://cloud.google.com/video-intelligence/docs/streaming/video-classification

I am conducting a series of tests on AutoML, using the code provided in the official documentation, and I am encountering an issue. After training the model with VortexAI, completing the process, and retrieving the Model ID, the Python APIs consistently return 'Requested model could not be loaded.' Honestly, the demos are poorly written, and the exceptions in the code are very implicit. Some demos don't work, and you have to make corrections in certain areas to get them to function properly.

python3 ./test.py
"Requested model could not be loaded."

The model was specifically trained for Video Intelligence in the VortexAI section and, in turn, did not function correctly. In the documentation, it's not clear whether the model necessarily requires an Endpoint. Both the code and the documentation have a comprehension issue.

Screen401

Langage dominant
Jupyter Notebook
Étoiles
8.1k
Forks
6.7k
Merge moyen
4 j 4 h
PR mergées (30 j)
8

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de GoogleCloudPlatform/python-docs-samples

Toutes les issues de GoogleCloudPlatform/python-docs-samples

Issues similaires

Plus d'issues Cloud

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.