MiuLab / DDQ

Deep Dyna-Q: Integrating Planning for Task-Completion Dialogue Policy Learning
MIT License
151 stars 46 forks source link

Model Testing: AttributeError: 'AgentDQN' object has no attribute 'action' #2

Closed LucyLu717 closed 6 years ago

LucyLu717 commented 6 years ago

Hello,

Thank you for releasing the code! I finished training the model and was testing it. The terminal gave me the error as follows:

Traceback (most recent call last): File "run.py", line 536, in run_episodes(num_episodes, status) File "run.py", line 470, in run_episodes episode_over, reward = dialog_manager.next_turn(record_training_data_for_user=False) File "../DDQ/src/deep_dialog/dialog_system/dialog_manager.py", line 67, in next_turn self.agent_action = self.agent.state_to_action(self.state) File "../DDQ/src/deep_dialog/agents/agent_dqn.py", line 89, in state_to_action act_slot_response = copy.deepcopy(self.feasible_actions[self.action][0]) AttributeError: 'AgentDQN' object has no attribute 'action'

I looked at the code and could not find the variable action anywhere else in agent_dqn.py. Could you take a look at it? I appreciate your help.

xjli commented 6 years ago

Thanks much.

we just update the repo, fixed a bug in agent_dyn.py, you can check the latest version, and re-run the test. I tested it, it works.

The command line to run test with trained model (supposed agt_9_48_90_0.62000.pkl is a trained model): python run.py --agt 9 --usr 1 --max_turn 40 --movie_kb_path ./deep_dialog/data/movie_kb.1k.p --dqn_hidden_size 80 --experience_replay_pool_size 5000 --episodes 500 --simulation_epoch_size 1 --run_mode 3 --act_level 0 --slot_err_prob 0.00 --intent_err_prob 0.00 --batch_size 16 --goal_file_path ./deep_dialog/data/user_goals_first_turn_template.part.movie.v1.p --warm_start 1 --warm_start_epochs 100 --write_model_dir ./deep_dialog/checkpoints/tmp/ --planning_steps 4 --grounded 0 --boosted 1 --train_world_model 1 --torch_seed 300 --trained_model_path ./deep_dialog/checkpoints/tmp/agt_9_48_90_0.62000.pkl

LucyLu717 commented 6 years ago

It works now. Thank you!