Question: I'm working with the new [Google object\_detection api](https://github.com/tensorflow/models/tree/master/object_detection) on my own dataset
In the config file there are fields `eval_config` and `eval_input_reader`, but I don't understand how to make them work.

I've also found a file in tensorflow/models/object\_detection/ the file `eval.py` which seems to run the evaluation but I don't entirely understand what these args are:

```
 ./eval \
        --logtostderr \
        --checkpoint_dir=path/to/checkpoint_dir \
        --eval_dir=path/to/eval_dir \
        --pipeline_config_path=pipeline_config.pbtxt

```

Suppose I have a model checkpoint (3 ckpt files meta, index and data) what should I do with them?

Answer: 
From what i see is that you are trying to generate a json object, this is not the way to do that.

```
$data = [];
while (($t = mysql_fetch_array($asd))) {
    $data[$t['a']] = $t['b'];
}

echo json_decode($data);

```

This will output a json string in the format you are trying to generate.

---

Sidenote 1:

The reason your rtrim in your code is not working is because you rtrim every line in the while loop, not the last line. But since you use `$rest =` you are also overwriting the value of `$rest` in every iteration.

---

Sidenote 2:

What @jeroen is saying in the comments, **do not** use `mysql_fetch_array`, these methods have been deprecated for some time. Look for PDO, mysqli or use a php framework with a proper ORM.
**Just to throw in an alternative solution:**  

You could not attach the trailing comma in the first place instead of trimming it afterwards. 

Let's assume you have the number of results in `$num_rows`, then you could do:

```
$i = 1;
while($t = mysql_fetch_array($asd)) {
    $rest = '"' . $t['a'] . '": "' . $t['b'] . (($i==$num_rows) ? '"' : '",');
    ++$i;
}
echo $rest;

```

Of course, note what some other answers pointed out: your `echo` was *in* the loop, but should stand outside of the loop.

**Please also note** that you are using the deprecated `mysql` extension; you should use `mysqli` instead. See the note in the PHP docs:

> 
> **Warning** This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO\_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
> 
> 
>