allenai / allennlp

An open-source NLP research library, built on PyTorch.
http://www.allennlp.org
Apache License 2.0
11.76k stars 2.25k forks source link

Add instructions for getting AllenNLP to run on Windows #612

Open matt-gardner opened 6 years ago

matt-gardner commented 6 years ago

It's currently a pain, apparently, and I'm not sure how much work we should do to support it (if you're reading this and want Windows support, add a comment please). But @OyvindTafjord was able to get it actually working by modifying some things:

  1. Got pytorch from 'conda install -c peterjc123 pytorch cuda80' (https://github.com/pytorch/pytorch/issues/494)
  2. Pip install of spacy (and other things) required some VS2015 library stuff (had to be same version as used to compile python).
  3. Pip install of sanic failed (because a dependency, uvloop, is not available for Windows) [ got around it by remove serve from commands ]
  4. In general 'pip install -r requirements.txt' worked weirdly and I ended up running each line individually, I didn't dig into why that was.
  5. Downloading dataset from S3 failed, I think because of non-allowed double quotes in the filename (from the etag) [ got around it by removing etag part of filename]
  6. Download also threw exception because it couldn't remove the temporary file, seems like Windows hangs onto the file for a bit, a 1 second pause didn't help [ got around by catching that exception, deleting the files manually later ]
  7. Had issues getting appropriate tensorflow/tensorboard installed where SummaryWriter was found [ got around it by instead using TensorboardX which somebody made for this purpose ]

I'm going to mark this issue as very low priority, until we hear people actually asking for us to support this. For now, the instructions will just live in this issue.

sugeknowles commented 6 years ago

+1 for windows support.

schmmd commented 6 years ago

3 resolved by https://github.com/allenai/allennlp/pull/636 5 resolved by https://github.com/allenai/allennlp/pull/618

kkhaladk commented 6 years ago

+1 for windows!

kearnsw commented 6 years ago

@matt-gardner : updated my allennlp install using pip install allennlp -U and am having the same issue mentioned in number 7 on linux. from tensorboardX import SummaryWriter works but from tensorboard import SummaryWriter throws ImportError: cannot import name 'SummaryWriter'. However the latter is the import call in trainer.py.

matt-gardner commented 6 years ago

@kearnsw: Hmm, sadly I don't have any ideas for you, other than maybe there's some helpful information in one of these: https://github.com/allenai/allennlp/issues/342 https://github.com/allenai/allennlp/pull/561.

DeNeutoy commented 6 years ago

@kearnsw this is a version issue, I just experienced the same thing myself. You need pip install tensorboard==1.0.0a6. PR incoming.

DeNeutoy commented 6 years ago

(you'll also need to uninstall all the other tensorboard distributions you installed, probably, because of namespace clashes etc.)

AlwaysHungrie commented 6 years ago

+1 for windows

mtchem commented 6 years ago

+1 for windows

ameasure commented 6 years ago

+1 for Windows

timbrgr commented 6 years ago

+1 for Windows

cpetroaca commented 6 years ago

+1 for Windows

jpzhangvincent commented 6 years ago

+1 for windows

faisalron commented 6 years ago

+1 for windows support

nelson-liu commented 6 years ago

This should hopefully be easier now that PyTorch 0.4 officially supports windows. But SpaCy is still an issue, I think (although last I heard, they were working on it)...

nelson-liu commented 6 years ago

now that #1232 is in , things should be a lot easier in this regard since most, if not all, paths should be platform-invariant. Perhaps it's time to set up some windows CI and see what goes wrong?

matt-gardner commented 6 years ago

@nelson-liu, we should probably wait until the pytorch 0.4 PR is merged next week, at least. And I don't know how to set up a windows CI. Any ideas?

nelson-liu commented 6 years ago

Yeah, sorry --- definitely wait until #1126 is in.

I'm not too sure where the CI configuration lives these days since the switch was made to teamcity, but it should be as "simple" as just setting up a new dockerfile running some variant of windows? Or we could go back to the open-source route and use appveyor

mvallet91 commented 6 years ago

+1 for Windows

Also...it's not completely clear that it doesn't work with Windows in the main page...took me half a day to figure it out hahah

davidlenz commented 6 years ago

+1 for windows.

nelson-liu commented 6 years ago

Note that jsonnet pip install isn't currently working with windows https://github.com/google/jsonnet/issues/476 , which is another blocker towards support...maybe it'd be worth falling back to json in the event of jsonnet being unavailable?

We'd need something that strips out json-incompatible stuff in the config fixtures, though, like the comments. That should be pretty easy, though...

also looks like spacy linking fails when you don't have admin access on windows, so you can't do spacy.load("en") and have to specify the model explicitly.

ProxyCausal commented 6 years ago

+1 for windows, resource module doesn't exist

skadai commented 6 years ago

+1 for windows.. jsonnet cannot be installed using pipT_T

TPF2017 commented 6 years ago

+1 for windows!

schmmd commented 6 years ago

Clearly we've been getting significant interest for running AllenNLP on Windows, but unfortunately our team has very little experience with running Python applications on Windows (or simply with Windows in general). Presently nobody on the core team uses Windows, and so even if we fix the current outstanding issues we're likely to have a regression.

I know that Docker has been building out support for Windows--is that a realistic option for running AllenNLP on Windows? If so, it has the advantage that we already support and run continuous integration on a Docker image.

Lorenzowy commented 6 years ago

+1 for windows...

joelgrus commented 6 years ago

I spent a few hours today investigating this, I couldn't get things 100% working, but I got some things working, here's what I did:

https://gist.github.com/joelgrus/8e994d908816ff91cd3df3602389dc0b

If you have success with this approach, let me know. If you have not-success, let me know that too, but I doubt I'll be much help in that case.

jerrygaoLondon commented 6 years ago

thanks, i can run v0.6.0 with the "getting_started" examples on windows 10 without jsonnet.

MLjian commented 5 years ago

+1 for windows.

BramVanroy commented 5 years ago

I'm not sure whether there are still things in the library that work on Linux and not on Windows, but considering the issue is still open I would like to +1 for full-blown Windows support.

schmmd commented 5 years ago

@BramVanroy things should mostly work on Windows, although we don't support and test that environment. We're unlikely to prioritize getting AllenNLP working seamlessly on Windows because neither the core development team nor most close collaborators use Windows. That said--we would welcome instructions for how to get AllenNLP running on Windows or people sharing their experience on this thread.

joelgrus commented 5 years ago

if people have specific examples of things that don't work on Windows, it's possible we can address those, but we don't really have the bandwidth to proactively make sure everything works.

BramVanroy commented 5 years ago

I am running Windows as my daily driver (1080TI), and Linux at work when I have no other choice, i.e. when libraries don't support Windows (K80, soon to be replaced). I definitely understand your standpoint, but as a user I think it is a shame that some of these supercool projects don't get the Windows-treatment. Again, I understand that this is not always feasible from a practical point of view.

I have only used ELMo, so my eperience with AllenNLP is limited. Installing is as straightforward as it is with Linux I suppose:

  1. (Optional) Set up a virtual environment, e.g. with pipenv
  2. Ensure that you have the correct version of PyTorch installed prior to installing AllenNLP. (Not sure what AllenNLP's minimum requirement is, though.)
  3. Ensure that you do not have spaCy 2.1 installed (this will conflict with AllenNLP's < 2.1 version requirement.
  4. Just pip install allennlp, or use a package manager of your choice.
vamsitharun commented 5 years ago

allennlp 0.7.0 is not working in windows python 3.6 pip install allennlp==0.7.0

torch 0.4.1 is working for me

Error:

ERROR: Could not find a version that satisfies the requirement torch<0.5.0,>=0.4.1 (from allennlp==0.7.0) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2) ERROR: No matching distribution found for torch<0.5.0,>=0.4.1 (from allennlp==0.7.0)

Anyone help me please

BramVanroy commented 5 years ago

You have to install a valid version of pytorch for your platform prior to installing allennlp. See the pytorch getting started web page.

vamsitharun commented 5 years ago

You have to install a valid version of pytorch for your platform prior to installing allennlp. See the pytorch getting started web page.

I required pytorch==0.4.1 and allennl==0.7.0 Before installing allennlp i installed pytorch 0.4.1 it is working fine. But while installing allennlp i am getting the above mentioned error

snijesh commented 5 years ago
pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install allennlp

to install alllennlp on windows, firstly install torch and torchvision using above command. Then install allennlp

BramVanroy commented 5 years ago
pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

pip install allennlp

Not sure why you posted this. But it's important to know that the installation of torch differs per set-up. See the website for more.

kunkaweb commented 4 years ago

+1 for windows.

BramVanroy commented 4 years ago

@kunkaweb It would help if you indicate what isn't working for you on Windows.

Zhuo-Ren commented 4 years ago

+1 for windows.

abhisheksms commented 4 years ago

+1 for windows.

ghost commented 4 years ago

+1 for Windows!

akshay1123 commented 4 years ago

+1 for windows

XiaZeng0223 commented 4 years ago

+1 for windows.

danmaxis commented 3 years ago

+1 for windows

SarneetGit commented 3 years ago

+1 for windows

LennertDefauw1 commented 3 years ago

Create a virtual environement in python and just run the following command:

pip install allennlp==1.0.0 allennlp-models==1.0.0

This worked for me on Windows.

Martin36 commented 3 years ago

+1 for Windows

AmazingAbhi commented 3 years ago

+1 for Windows

I am getting this error in Windows: image