tensorflow/models · error · CommandExecutionError

Error executing command: {cmd}. Error: {stderr}

Error message

Error executing command: {cmd}. Error: {stderr}

What it means

Error "Error executing command: {cmd}. Error: {stderr}" thrown in tensorflow/models.

Source

Thrown at official/projects/waste_identification_ml/model_inference/download_and_unzip_models.py:67

  def __init__(self, cmd, returncode, stderr):
    super().__init__(f"Error executing command: {cmd}. Error: {stderr}")
    self.cmd = cmd
    self.returncode = returncode
    self.stderr = stderr


def execute_command(cmd: str) -> str:
  """Executes a shell command and returns its output."""
  result = subprocess.run(
      cmd,
      shell=True,
      stdout=subprocess.PIPE,
      stderr=subprocess.PIPE,
      check=False,
  )

  if result.returncode != 0:
    raise CommandExecutionError(
        cmd, result.returncode, result.stderr.decode("utf-8")
    )

  return result.stdout.decode("utf-8")


def main(_) -> None:
  # Download the provided files
  execute_command(f"wget {args.material_url}")
  execute_command(f"wget {args.material_form_url}")

  # Create directories
  os.makedirs("material", exist_ok=True)
  os.makedirs("material_form", exist_ok=True)

  # Unzip the provided files
  zip_file1 = os.path.basename(args.material_url)
  zip_file2 = os.path.basename(args.material_form_url)

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/waste_identification_ml/model_inference/download_and_unzip_models.py:67 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24). Data as JSON: /api/errors/b7a8e1255eb8d92b. Report an issue: GitHub.