nottombrown / rl-teacher

Code for Deep RL from Human Preferences [Christiano et al]. Plus a webapp for collecting human feedback
MIT License
559 stars 95 forks source link

Django error while trying to train an agent with human feedback #35

Closed Axxeption closed 7 years ago

Axxeption commented 7 years ago

I try to run your code to explore the possibilities of rl-teacher. It looks amazing. But I am totally stuck on a error related to Django. This is the traceback:

Using TensorFlow backend.
Setting things up...
No label limit given. We will request one label every few seconds.
2017-11-21 14:34:27.636215: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
Starting random rollouts to generate pretraining segments. No learning will take place...
Collected 40/352 segments
Collected 80/352 segments
Collected 120/352 segments
Collected 160/352 segments
Collected 200/352 segments
Collected 240/352 segments
Collected 280/352 segments
Collected 320/352 segments
Successfully collected 352 segments
Traceback (most recent call last):
  File "rl_teacher/teach.py", line 324, in <module>
    main()
  File "rl_teacher/teach.py", line 277, in main
    comparison_collector.add_segment_pair(pretrain_segments[i], pretrain_segments[i + pretrain_labels])
  File "/home/axel/rl-teacher/rl_teacher/rl_teacher/comparison_collectors.py", line 100, in add_segment_pair
    comparison_id = self._create_comparison_in_webapp(left_seg, right_seg)
  File "/home/axel/rl-teacher/rl_teacher/rl_teacher/comparison_collectors.py", line 91, in _create_comparison_in_webapp
    priority=1.
  File "/home/axel/miniconda3/envs/rlteacher/lib/python3.5/site-packages/django/db/models/base.py", line 573, in __init__
    raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
TypeError: 'media_url_2' is an invalid keyword argument for this function

I started my django in an other terminal:


sudo /home/axel/miniconda3/envs/rlteacher/bin/python human-feedback-api/manage.py runserver 0.0.0.0:8000
WARNING:root:Tried to double configure the API, ignore this if running the Django app directly
WARNING:root:Tried to double configure the API, ignore this if running the Django app directly
Performing system checks...

System check identified no issues (0 silenced).
November 21, 2017 - 05:29:01
Django version 1.11.7, using settings 'human_feedback_site.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
[21/Nov/2017 05:29:39] "GET / HTTP/1.1" 200 2454
[21/Nov/2017 05:29:39] "GET /static/lang-logo.93d5ed025323.png HTTP/1.1" 200 19861
WARNING:django.request:Not Found: /favicon.ico
[21/Nov/2017 05:29:40] "GET /favicon.ico HTTP/1.1" 404 85

```I run everything in python 3.5.2 wich was necessary for the MuJoCo. I succeed the other tests in the post like Synthetic labels.

Maybe there is a small bug in this code? Or am I using a wrong Django..? 

Thanks!
nottombrown commented 7 years ago

Strange. I haven’t seen that error before when running on py3.5. Could you try making a fresh conda environment and running it again?

Also could you please run pip freeze | grep django to see if you have the correct Django version On Tue, Nov 21, 2017 at 5:49 AM Axel Vulsteke notifications@github.com wrote:

I try to run your code to explore the possibilities of rl-teacher. It looks amazing. But I am totally stuck on a error related to Django. This is the traceback: Using TensorFlow backend. Setting things up... No label limit given. We will request one label every few seconds. 2017-11-21 14:34:27.636215: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA Starting random rollouts to generate pretraining segments. No learning will take place... Collected 40/352 segments Collected 80/352 segments Collected 120/352 segments Collected 160/352 segments Collected 200/352 segments Collected 240/352 segments Collected 280/352 segments Collected 320/352 segments Successfully collected 352 segments Traceback (most recent call last): File "rl_teacher/teach.py", line 324, in main() File "rl_teacher/teach.py", line 277, in main comparison_collector.add_segment_pair(pretrain_segments[i], pretrain_segments[i + pretrain_labels]) File "/home/axel/rl-teacher/rl_teacher/rl_teacher/comparison_collectors.py", line 100, in add_segment_pair comparison_id = self._create_comparison_in_webapp(left_seg, right_seg) File "/home/axel/rl-teacher/rl_teacher/rl_teacher/comparison_collectors.py", line 91, in _create_comparison_in_webapp priority=1. File "/home/axel/miniconda3/envs/rlteacher/lib/python3.5/site-packages/django/db/models/base.py", line 573, in init raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0]) TypeError: 'media_url_2' is an invalid keyword argument for this function

I started my django in an other terminal: sudo /home/axel/miniconda3/envs/rlteacher/bin/python human-feedback-api/manage.py runserver 0.0.0.0:8000 WARNING:root:Tried to double configure the API, ignore this if running the Django app directly WARNING:root:Tried to double configure the API, ignore this if running the Django app directly Performing system checks...

System check identified no issues (0 silenced). November 21, 2017 - 05:29:01 Django version 1.11.7, using settings 'human_feedback_site.settings' Starting development server at http://0.0.0.0:8000/ Quit the server with CONTROL-C. [21/Nov/2017 05:29:39] "GET / HTTP/1.1" 200 2454 [21/Nov/2017 05:29:39] "GET /static/lang-logo.93d5ed025323.png HTTP/1.1" 200 19861 WARNING:django.request:Not Found: /favicon.ico [21/Nov/2017 05:29:40] "GET /favicon.ico HTTP/1.1" 404 85

I run everything in python 3.5.2 wich was necessary for the MuJoCo. I succeed the other tests in the post like Synthetic labels.

Maybe there is a small bug in this code? Or am I using a wrong Django..?

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nottombrown/rl-teacher/issues/35, or mute the thread https://github.com/notifications/unsubscribe-auth/AASt3_43I_xRnu_FmBaf8SoawDpCVD-hks5s4tTugaJpZM4Ql3dV .

--

I enjoy constructive feedback. If you have anything you'd like to tell me anonymously, you can post it here: http://www.admonymous.com/tom

Axxeption commented 7 years ago

thanks for your fast answer! I did installed everything over but as root. now it seems to work, but maybe because I am root, I'm an anonymous user for the google cloud?

I got this error: Successfully collected 352 segments Copying media to gs://rl-teacher-thesisrlteacherav/e8ab24cf-ed22-4601-8b63-30e2cb41834c-right.mp4 in a background process Copying media to gs://rl-teacher-thesisrlteacherav/8d77b7e4-f97a-4605-b0c3-d71c0cc215e8-right.mp4 in a background process Copying media to gs://rl-teacher-thesisrlteacherav/e8ab24cf-ed22-4601-8b63-30e2cb41834c-left.mp4 in a background process Copying media to gs://rl-teacher-thesisrlteacherav/8d77b7e4-f97a-4605-b0c3-d71c0cc215e8-left.mp4 in a background process 0/175 comparisons labeled. Please add labels w/ the human-feedback-api. Sleeping... ServiceException: 401 Anonymous users does not have storage.objects.list access to rl-teacher-thesisrlteacherav. ServiceException: 401 Anonymous users does not have storage.objects.list access to rl-teacher-thesisrlteacherav. ServiceException: 401 Anonymous users does not have storage.objects.list access to rl-teacher-thesisrlteacherav. ServiceException: 401 Anonymous users does not have storage.objects.list access to rl-teacher-thesisrlteacherav. Copying media to gs://rl-teacher-thesisrlteacherav/991a8b36-eaf3-4081-a8c0-a5727286930a-left.mp4 in a background process Copying media to gs://rl-teacher-thesisrlteacherav/991a8b36-eaf3-4081-a8c0-a5727286930a-right.mp4 in a background process Copying media to gs://rl-teacher-thesisrlteacherav/5516e1a4-571f-482a-b273-c40fb5335360-left.mp4 in a background process Copying media to gs://rl-teacher-thesisrlteacherav/5516e1a4-571f-482a-b273-c40fb5335360-right.mp4 in a background process

can I provide credentials in the code..?

pip freeze | grep django gives me no output..?

nottombrown commented 7 years ago

Glad that you solved the problem! For the new issue, you'll need to create your own GCS bucket as described here: https://github.com/nottombrown/rl-teacher/#create-a-gcs-bucket-to-store-rendered-trajectory-segments

Closing this issue because the original problem is resolved.