Start a mint instance. TODO(Yangqing): this does not work well under ipython yet. According to https://github.com/ipython/ipython/issues/5862 writing up some fix is a todo item.
(root_folder=None, port=None)
| 122 | return port |
| 123 | |
| 124 | def StartMint(root_folder=None, port=None): |
| 125 | """Start a mint instance. |
| 126 | |
| 127 | TODO(Yangqing): this does not work well under ipython yet. According to |
| 128 | https://github.com/ipython/ipython/issues/5862 |
| 129 | writing up some fix is a todo item. |
| 130 | """ |
| 131 | from caffe2.python.mint import app |
| 132 | if root_folder is None: |
| 133 | # Get the root folder from the current workspace |
| 134 | root_folder = C.root_folder() |
| 135 | if port is None: |
| 136 | port = _GetFreeFlaskPort() |
| 137 | process = Process( |
| 138 | target=app.main, |
| 139 | args=( |
| 140 | ['-p', str(port), '-r', root_folder], |
| 141 | ) |
| 142 | ) |
| 143 | process.start() |
| 144 | print('Mint running at http://{}:{}'.format(socket.getfqdn(), port)) |
| 145 | return process |
| 146 | |
| 147 | |
| 148 | def StringifyProto(obj): |
nothing calls this directly
no test coverage detected
searching dependent graphs…