Skip to main content

TFSurgeon

Allows for dynamic tensorflow keras model edition. You can install this package with pip and call it as from tfsurgeon import edit_model.

How to use

  • remove layers based on layer type
  • remove layers based on name or index
  • replace layers from one type to another
  • replace specific layer (name) by another layer (callable)

see docstring for examples in src/tfsurgeon/tfsurgeon.py.

import

from tfsurgeon import edit_model
import tensorflow as tf

model = tf.keras.applications.MobileNetV2(weights=None)
new_model = edit_model(
    model=model,
    replace_layers_by_types=[
        [tf.keras.layers.BatchNormalization, tf.keras.layers.LayerNormalization]
    ],
    verbose=True,
)

CLI

no supported yet

Metadata

Release files for tfsurgeon 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tfsurgeon 0.0.8
File Size Uploaded Provenance
tfsurgeon-0.0.8.tar.gz 7.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tfsurgeon 0.0.8
File Interpreter ABI Platform
tfsurgeon-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 20.5 kB

Release files / tfsurgeon-0.0.8.tar.gz

Download URL tfsurgeon-0.0.8.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
82548684f9f5b36028bf846ccc944a1615e8076f4ffdfc714baf6939990beace
BLAKE2b-256 checksum
How to use checksums
3a5faa466b7cdea768266a513c73709bc5912ff49f6ad42755d982ffeb575f01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / tfsurgeon-0.0.8-py3-none-any.whl

Download URL tfsurgeon-0.0.8-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8dacaebbcd399bf9792e7463818df2e820a3ec3cc32a71f04489db9ae02b8ab6
BLAKE2b-256 checksum
How to use checksums
7064d23a0484829de1f3b87e08c82644112f3e7845eee72b56acb8381219f27d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Security for tfsurgeon 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page