Open xuewyang opened 4 years ago
I also retrieve all data successfully by: mongorestore --db goodnews --host=localhost --port=27017 --drop --gzip --archive=goodnews-2020-04-21 2020-06-25T22:21:40.146-0400 576180 document(s) restored successfully. 0 document(s) failed to restore
Oh, my bad. I didn't setup the right image folder. Please help me with the mangodb question. Thank you.
Yep you're right about the image folder. Those repeated log messages come from here. Basically in the for-loop below it, if the program can't find any images, it will just keep skipping to the next iteration, and you're stuck in an infinite loop! Make sure you you extract the images to data/goodnews/images_processed
or update the image path in the config file.
MongoDB Community Edition is free. We don't need the advanced features in the paid enterprise version since we're not deploying it in a production environment. I think you have installed it correctly since you've managed to successfully restored the dump.
In the README file under Getting Data, I provided some sample Python code on how to interact with the database to retrieve an article from the database, get the corresponding image, etc. using the pymongo
library. You can use that code as a starting point. Maybe copy and paste that code into a Jupyter notebook and just print out the results to see how the data are stored and represented.
If you just want to replicate the experiments, the only two commands you need is starting the mongo database and restoring the dump (both of which you have successfully done).
Yes, it is trained successfully now. Can you please also explain how to train without install 'tell'? I am working for someone. Even though I can run your script, I can't not install on their services. Can you please tell me what are the 'train', 'dataloader', 'model', 'evaluate', etc? What scripts involved in each part? Thank you. This also help me to implement my own model because I cannot install 'tell' for my model.
I made it work, though it took me some time. Thank you.
When you call
tell train expt/goodnews/1_lstm_glove/config.yaml -f
that's really just a shortcut for
python -m tell.commands train expt/goodnews/1_lstm_glove/config.yaml -f
so the entry point of the program is here.
You still need to install the tell
package because that's the easiest way for the files in different directories to reference each other. If you can't install tell
, you need to turn all the import tell
lines into relative imports, which would look quite messy.
A lot of the programming patterns used in this repo are based on the AllenNLP library. In particular, when you run tell train
, it calls AllenNLP's train_model
function here, which will eventually make use of the trainer here.
All the dataloaders sit in this directory and all the models sit in this directory. Which data loader or model the program will use depends on what you specify in the config.yaml
file.
I suggest having a quick look at the AllenNLP tutorials if you want to see how everything (config file, trainer, dataloader, etc) ties together.
Thank you, very helpful. Will let you know if I have more questions.
Do you use Anaconda Python? I think you can install mongo without admin access in Anaconda:
conda install -c anaconda mongodb
Otherwise I can give you a JSON dump if you want.
On Wed, 1 Jul 2020 at 14:19, Xuewen Yang notifications@github.com wrote:
Hi Alasdair, If I don't use mangodb, can I find a way to get processed data? My machine has120GB memory. Maybe that is enough. The reason I want to do without mangodb is that I have to ask admin to install it which might not be approved, but I will try to persuade him.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alasdairtran/transform-and-tell/issues/4#issuecomment-652180174, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQXV4HTEJXMUX5K4CNXN3DRZK2MJANCNFSM4OJKXJOQ .
Yes, it works. I don't know that I can use conda to install it. Thank you. I used https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ before.
I installed it via conda. But now when I run mongorestore --db goodnews --host=localhost --port=27017 --drop --gzip --archive=data/mongobackups/goodnews-2020-04-21 It still needs to apt-install If possible, please give me a JSON dump so that I won't need docker. My email is xuewen.yang@stonybrook.edu
Thank you.
Ok sure. I'll extract and upload the JSON dump. It might take a few days.
On Wed, 1 Jul 2020 at 22:57, Xuewen Yang notifications@github.com wrote:
Yes, it works. I don't know that I can use conda to install it. Thank you. I used https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ before.
I installed it via conda. But now when I run mongorestore --db goodnews --host=localhost --port=27017 --drop --gzip --archive=data/mongobackups/goodnews-2020-04-21 It still needs to apt-install If possible, please give me a JSON dump so that I won't need docker. My email is xuewen.yang@stonybrook.edu
Thank you.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alasdairtran/transform-and-tell/issues/4#issuecomment-652401971, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQXV4FX7JZZIJ4TYYHWKLDRZMXCLANCNFSM4OJKXJOQ .
Hi, please don't bother to do that if it takes that many days. I can figure this out. The admin is helping me. I think I can make it.
Cool good luck with setting up mongo then. The command to extract the JSON dump is easy, but it does probably take two or three days to upload the data to the cloud.
On Thu, 2 Jul 2020 at 01:03, Xuewen Yang notifications@github.com wrote:
Hi, please don't bother to do that if it takes that many days. I can figure this out. The admin is helping me. I think I can make it.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alasdairtran/transform-and-tell/issues/4#issuecomment-652472734, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQXV4HU3ZEPN4A2DERLQWDRZNF3ZANCNFSM4OJKXJOQ .
Can I bother you to upload the jsons. I can't come up with setting up the mongo. Thank you.
I solved the problem with the following scripts. Thanks.
docker run -it --rm -v /home/xyang/captioning-xuewen/goodnews:/xuewen -v /home/xyang/mongodb:/data/db --network=host -p 27017:27017 --name news1 mongo mongorestore --db goodnews --host=localhost --port=27017 --drop --gzip --archive=goodnews-2020-04-21
Hi Alasdair, Thank you for your great work. I have two questions. Hope you can help me out.