tindetheus icon indicating copy to clipboard operation
tindetheus copied to clipboard

running in Docker: ERROR: No facebook or tinder token has been set.

Open PhinPhin opened this issue 5 years ago • 10 comments

Hi, I end up in that error after running "tindetheus browse":

root@04ccce1f985e:/# tindetheus browse Traceback (most recent call last): File "/usr/local/bin/tindetheus", line 11, in <module> load_entry_point('tindetheus', 'console_scripts', 'tindetheus')() File "/tindetheus/tindetheus/tindetheus.py", line 274, in command_line_run raise('ERROR: No facebook or tinder token has been set.' TypeError: exceptions must derive from BaseException root@04ccce1f985e:/# tindetheus browse Traceback (most recent call last): File "/usr/local/bin/tindetheus", line 11, in <module> load_entry_point('tindetheus', 'console_scripts', 'tindetheus')() File "/tindetheus/tindetheus/tindetheus.py", line 274, in command_line_run raise('ERROR: No facebook or tinder token has been set.' TypeError: exceptions must derive from BaseException root@04ccce1f985e:/# tindetheus browse Traceback (most recent call last): File "/usr/local/bin/tindetheus", line 11, in <module> load_entry_point('tindetheus', 'console_scripts', 'tindetheus')() File "/tindetheus

I both tried the Tinder Auth Token and the Facebook Auth Token. I assume something like "EAAGmXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXV0ZD" is right?

I run the docker-image in a Ubuntu that runs on a VirtualBox on Win10, doubt that is the reason for the error though?

PhinPhin avatar Oct 29 '20 16:10 PhinPhin

So what this sounds like, is that the .env or the environment variable isn't being set.

To see if this is the case, try to set the environment variable manually in bash before calling tindetheus browse

Either

export TINDER_AUTH_TOKEN="TODO"
export FACEBOOK_AUTH_TOKEN="TODO"

And you should see a different error.

That token seems right, and yes this would work in a VBox in Windows. WSL should work too.

cjekel avatar Oct 29 '20 17:10 cjekel

Hi, thank you for your reply :)

Sadly, the error didn't change :| I haven't tried it with WSL, as my linux-debugging knowledge seems already here at the end ;) Thought with the docker-image it would "just work"... obviously not :P

.env is in /tinder/tindetheus, maybe it's missing some file or something else is wrong?:

/tinder └── tindetheus ├── 0B5MzpY9kBtDVZ2RpVDYwWmxoSUk ├── CHANGELOG.md ├── Dockerfile ├── examples │   ├── how_does_tindetheus_work.png │   ├── make_al_like_dislike_folders.py │   ├── open_database.py │   └── README.md ├── GETTING_STARTED.md ├── LICENSE ├── Makefile ├── MANIFEST ├── MANIFEST.in ├── models │   └── 20170512-110547 │   ├── 20170512-110547.pb │   ├── model-20170512-110547.ckpt-250000.data-00000-of-00001 │   ├── model-20170512-110547.ckpt-250000.index │   └── model-20170512-110547.meta ├── README.md ├── requirements.txt ├── scripts │   └── env.bat ├── setup.py ├── tests │   └── tests.py ├── tindetheus │   ├── config.py │   ├── export_embeddings.py │   ├── facenet_clone │   │   ├── align │   │   │   ├── align_dataset_mtcnn.py │   │   │   ├── align_dataset.py │   │   │   ├── align_dlib.py │   │   │   ├── det1.npy │   │   │   ├── det2.npy │   │   │   ├── det3.npy │   │   │   ├── detect_face.py │   │   │   └── init.py │   │   ├── calculate_filtering_metrics.py │   │   ├── classifier.py │   │   ├── compare.py │   │   ├── decode_msceleb_dataset.py │   │   ├── download_and_extract_model.py │   │   ├── download_and_extract.py │   │   ├── download_vgg_face_dataset.py │   │   ├── facenet.py │   │   ├── freeze_graph.py │   │   ├── generative │   │   │   ├── calculate_attribute_vectors.py │   │   │   ├── calculate_dataset_normalization.py │   │   │   ├── init.py │   │   │   ├── models │   │   │   │   ├── dfc_vae_large.py │   │   │   │   ├── dfc_vae.py │   │   │   │   ├── dfc_vae_resnet.py │   │   │   │   ├── init.py │   │   │   │   └── vae_base.py │   │   │   ├── modify_attribute.py │   │   │   └── train_vae.py │   │   ├── init.py │   │   ├── lfw.py │   │   ├── models │   │   │   ├── dummy.py │   │   │   ├── inception_resnet_v1.py │   │   │   ├── inception_resnet_v2.py │   │   │   ├── init.py │   │   │   └── squeezenet.py │   │   ├── train_softmax.py │   │   ├── train_tripletloss.py │   │   └── validate_on_lfw.py │   ├── image_processing.py │   ├── init.py │   ├── machine_learning.py │   ├── tinder_client.py │   ├── tindetheus_align.py │   ├── tindetheus.py │   └── version.py └── VALIDATE_GUIDE.md

PhinPhin avatar Oct 29 '20 17:10 PhinPhin

Update: I just created the .env inside of the docker-instance, that way it it seems to work half'ish? I get the stats of the profiles in the console, but there is no window opening with photos...?

EDIT: is it missing a tool to display the images? I can't find any log in /var/log ... any way to hunt this down?

PhinPhin avatar Oct 29 '20 17:10 PhinPhin

^^ cool that seems to work.

So what I was doing, in the virtual box, navigate Files to tinder/temp_images and the profile images should populate in here. Set to the max thumbnail size, and it should work out well.

cjekel avatar Oct 29 '20 17:10 cjekel

Ahhhh :) The readme sounded like a window would open with each new pic :) Maybe that should be added.

It seems to work so far, gonna try it. Thanks for your help and for this tool! :)

PhinPhin avatar Oct 29 '20 17:10 PhinPhin

I didn't set up any way to natively visualize the images from docker. If you are using a shared file system between docker and your vbox, then the above would work. Otherwise, you'll need to call docker such that matplotlib visualization can work.

http://wiki.ros.org/docker/Tutorials/GUI

It's a bit more complicated docker call to get the visualization to work. Something like

docker run --rm -it \
   --user=$(id -u) \
   --env="DISPLAY" \
   --workdir=/app \
   --volume="$PWD":/app \
   --volume="/etc/group:/etc/group:ro" \
   --volume="/etc/passwd:/etc/passwd:ro" \
   --volume="/etc/shadow:/etc/shadow:ro" \
   --volume="/etc/sudoers.d:/etc/sudoers.d:ro" \
   --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \

from https://stackoverflow.com/questions/46018102/how-can-i-use-matplotlib-pyplot-in-a-docker-container

cjekel avatar Oct 29 '20 17:10 cjekel

Nah it's okay. Using the temp-folder works good enough. I just didn't figure out how it's meant to be done with the docker-setup :)

Oh just before I forget it: the AI is only trained with the images in the liked/disliked dir? Could I swap photos from one dir to the other to refine the choice a bit?

PhinPhin avatar Oct 29 '20 18:10 PhinPhin

hm, train gives me now an error that /models/20170512-110547/ is not found... but it's in /tinder/models/20170512-110547/.

What's the sourcepath in .env?

Yep, indeed: /tinder/models/20170512-110547 is the needes path...

PhinPhin avatar Oct 29 '20 18:10 PhinPhin

Oh just before I forget it: the AI is only trained with the images in the liked/disliked dir? Could I swap photos from one dir to the other to refine the choice a bit?

Yes. You can move images from one folder to another. You can also add photos manually to each folder.

I made some validation function so you could evaluate predictions on some images the model wasn't trained on. It's interesting to look at for some qualitative goodness of model.

What's the sourcepath in .env? Yep, indeed: /tinder/models/20170512-110547 is the needes path...

Ya it probably needs the absolute path in that case.

Let me know if you run into bugs, or areas of improvement. PRs welcome! Have fun. :)

cjekel avatar Oct 29 '20 19:10 cjekel

Sure, will do :)

The only thing I can think about would be parsing of the profile-text for keywords and skip auto-like/dislike for manual choice (or just do a like even if the pictures failed).

PhinPhin avatar Oct 29 '20 21:10 PhinPhin