You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 25, 2023. It is now read-only.
I'm just getting into machine learning, and I wanted to try converting something into the coreml format. I wrote a very simple torch program which (not complete, I don't have access to the latest one right now) was something like this:
importnumpyasnpimporttorchfromtorch.autogradimportVariablemodel=torch.nn.Linear(1, 1)
loss_fn=torch.nn.MSELoss(size_average=False)
optimizer=torch.optim.SGD(model.parameters(), lr=0.01)
fortinrange(10000):
x=Variable(torch.from_numpy(np.random.random((1,1)).astype(np.float32)))
y=x*3y_pred=model(x)
loss=loss_fn(y_pred, y)
optimizer.zero_grad()
loss.backward()
optimizer.step()
printloss.data[0]
torch.save... # some more code here
Then I installed Anaconda and PyTorch, along with coremltools, but when I run pip2 install -U torch2coreml I get the error:
Collecting torch2coreml
Using cached torch2coreml-0.2.0-py2.7-none-any.whl
Collecting torch (from torch2coreml)
Using cached torch-0.1.2.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/_5/xy3fwjvx6h9fj8my9t_lnl_c0000gn/T/pip-build-EpKgGE/torch/setup.py", line 11, in <module>
raise RuntimeError(README)
RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).
Please follow the instructions at http://pytorch.org/ to install with miniconda instead.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/_5/xy3fwjvx6h9fj8my9t_lnl_c0000gn/T/pip-build-EpKgGE/torch/
I'm probably making some silly mistake here, so any help is appreciated. Thanks!