# tensorflow-example **Repository Path**: cubeml-io/tensorflow-example ## Basic Information - **Project Name**: tensorflow-example - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-03-08 - **Last Updated**: 2024-04-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 分布式训练测试代码 ### 启动参数 - 镜像:bj-sm-ai-registry.cn-beijing.cr.aliyuncs.com/cubeml-public/tensorflow:2.6.0-gpu - 代码仓库:https://gitee.com/cubeml-io/tensorflow-example.git (master) - 输出路径:/tensorflow_mnist_savemodel - 数据集:/dataset/MNIST - 启动命令:["/bin/sh","-c","python /home/code/tensorflow_2.x_mnist_savemodel.py --strategy=multi_worker_mirrored --data-dir=/home/dataset/0/raw --output-dir=/home/output --epochs=100"] 启动接口数据 ```json { "name": "test-train", "desc": "", "image_url": "bj-sm-ai-registry.cn-beijing.cr.aliyuncs.com/cubeml-public/tensorflow:2.6.0-gpu", "priority": "high", "input_params": { "inputs": [], "_inputs": [], "datasets": [{ "id": "018e2c3a11237e5eb08f2fa9ef03ae11" }], "_datasets": ["018e2c3a11237e5eb08f2fa9ef03ae11"], "_models": [], "models": [], "code": { "code_url": "https://gitee.com/cubeml-io/tensorflow-example.git", "branch": "master" }, "output": { "path": "/tensorflow_mnist_savemodel" } }, "train": { "enable_host_network": false }, "tasks": [{ "resources": { "node_num": 1, "resource_id": "gpu.V100.c7m31g1m0.1xlarge", "resource_type": "shared" }, "node_num": 1, "resource_id": "gpu.V100.c7m31g1m0.1xlarge", "task_name": "task", "resource_type": "shared", "uuid": "9c6cd19b-3b30-42e2-8a8a-be68cecbf731", "depends_on": [], "command": ["/bin/sh", "-c", "python /home/code/tensorflow_2.x_mnist_savemodel.py --strategy=multi_worker_mirrored --data-dir=/home/dataset/0/raw --output-dir=/home/output --epochs=100"] }], "resourceType": "shared", "distributed": false, "roles": "workload" } ``` 页面详情 ![img.png](img.png) ### 模型注册 为模型添加config文件: ![img_1.png](img_1.png) 在页面进行注册: ![img_2.png](img_2.png) ### 发布推理 拿到推理url进行请求: 制作数据的代码在`sample_inference/mnist/infer_test.py`: curl -v -d '{"inputs":[{"name":"input","shape":[1,1,28,28],"datatype":"FP32","data":[]}]}' -X POST http://localhost:8000/v2/models/pytorch_mnist_onnx_standalone/versions/1/infer