Code Monkey home page Code Monkey logo

custom-vision-move-project's Introduction

page_type languages products description urlFragment
sample
python
azure
Sample script to copy a Custom Vision project from one Subscription/Region to another.
custom-vision-move-project

This sample project is deprecated. Please use export/import API provied by Custom Vision to move projects.

Move Custom Vision Project

Sample script to copy a Custom Vision project from one Subscription/Region to another.

Getting Started

Prerequisites

Installation

To run the script you first install the requirements

pip install -r requirements.txt

Quickstart

To run you need this information:

From the settings page of the source Subscription (where you want to copy from)

  • Source Project Id
  • Source Training Key
  • Source Endpoint, if not south central us

From the settings page of the destination Subscription (where you want to copy to)

  • Destination Training Key
  • Destination Endpoint, if not south central us

Then run the python script with the necessary information:

python migrate_project.py -p "<project id>" -s "<source training key>" -d "<destination training key>"

This script will recreate a project with the destination training-key and download/upload all of the tags, regions, and images. It will leave you with a new project in your new subscription with no trained iterations, from here you can train a new iteration.

The migration script assumes you are migrating projects in South Central US. If you need to migrate a project from one region to another then you can specify the endpoints.

For example, to migrate from South Central US to North Europe:

python migrate_project.py -p "<project id>" -s "<source training key>" -se "https://southcentralus.api.cognitive.microsoft.com" -d "<destination training key>" -de "https://northeurope.api.cognitive.microsoft.com"

Resources

Training SDK Documentation

custom-vision-move-project's People

Contributors

anrothmsft avatar areddish avatar joyhui avatar microsoftopensource avatar msftgits avatar v-rajagt-zz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

custom-vision-move-project's Issues

Solution for this error --> ImportError: No module named azure.cognitiveservices.vision.customvision.training

If anybody ran into this issue or ran into something similar, here's what I did to overcome:

1: Install Python3 (not update) http://osxdaily.com/2018/06/13/how-install-update-python-3x-mac/
2: Install Pip
3: pip install azure
4: pip install azure-cognitiveservices-vision-customvision

Important! Since I'm using python3 - the final commands should call python3 not python like this:
python3 migrate_project.py -p "asdf-asdf-asdf-asdf-asdfasdf" -s "asdfasdasdfasdfasdfasdf" -d "asdfasdfasdfasdfasdfasdf"

ERROR: Failed to upload image batch midway causing only part of images migrated

Hi there,

I was trying to migrate 4 of my projects from a directory to another directory, 3 of them are successfully migrated.

But on the last project, the migration failed midway and only parts of my dataset are migrated.

This is the quantity of dataset that I have
image

And this is the migrated dataset
image

Here is the error code

ERROR: Failed to upload image batch Traceback (most recent call last): File ".\migrate_project.py", line 118, in <module> source_images = migrate_images(src_trainer, dest_trainer, args.project_id, destination_project.id, tags) File ".\migrate_project.py", line 53, in migrate_images print ("\tImage status:", i.id, i.status)AttributeError: 'ImageCreateResult' object has no attribute 'id'

image

Operation returned an invalid status code 'PermissionDenied'

Unable to move the project between subscriptions. Receive the following error.

('Collecting information for source project:', 'a6287b42-0ecb-406a-9587-ac770235cfb7')
Traceback (most recent call last):
File "migrate_project.py", line 119, in
destination_project = migrate_project(src_trainer, dest_trainer, args.project_id)
File "migrate_project.py", line 85, in migrate_project
src_project = src_trainer.get_project(project_id)
File "C:\Users\saravanan.m.platformio\python27\lib\site-packages\azure\cognitiveservices\vision\customvision\training\operations_custom_vision_training_client_operations.py", line 284, in get_project
raise models.CustomVisionErrorException(self._deserialize, response)
azure.cognitiveservices.vision.customvision.training.models._models.CustomVisionErrorException: Operation returned an invalid status code 'PermissionDenied'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.