felipecruz / CFRBM

CFRBM is a implementation of the RBM model to the collaborative filtering task
MIT License
40 stars 27 forks source link

ValueError: No JSON object could be decoded #1

Open ngcthuong opened 8 years ago

ngcthuong commented 8 years ago

I got this error when running your code in Anaconda2 prompt. Is there any way to fix this. My System: Window 10, Anaconda 2, python 2.7.

Thanks for your time,

C:\CFRBM-master>make run
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python cfrbm/user_based.py ubased.json
Using gpu device 0: GeForce GTX 960 (CNMeM is disabled, cuDNN 5005)
Traceback (most recent call last):
  File "cfrbm/user_based.py", line 168, in <module>
    experiments = read_experiment(sys.argv[0])
  File "C:\CFRBM-master\cfrbm\experiments.py", line 7, in read_experiment
    experiments = json.loads(data.read())['experiments']
  File "C:\Users\user4\Anaconda2\lib\json\__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "C:\Users\user4\Anaconda2\lib\json\decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\user4\Anaconda2\lib\json\decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
makefile:2: recipe for target 'run' failed
make: *** [run] Error 1
felipecruz commented 8 years ago

Hi @AtenaKid . This do not happen in my linux nor OSX Boxes. Can you wait few days so I can try at my wife's computer? (windows 10 like yours)

felipecruz commented 8 years ago

Hello @AtenaKid . I had some progress running on a windows box but I'm stuck on another problem which is an importing error. Give few more days :)

felipecruz commented 8 years ago

Hello @AtenaKid . This code is not the original on the repository

experiments = read_experiment(sys.argv[0])

If you change sys.argv[0] to sys.argv[1] and correct json file will be parsed

ngcthuong commented 8 years ago

Hello @felipecruz, thank you for your feedback. Could you give more suggestion on how to correct json file?

felipecruz commented 8 years ago

An experiment json file working example:

{
  "experiments": [
    {
      "name": "100k-u1xu1",
      "train_path": "ml-100k/u1.base",
      "test_path": "ml-100k/u1.test",
      "sep": "\t",
      "configs": [
        {
          "name": "initial_experiment",
          "epochs": 100,
          "batch_size": 10,
          "number_hidden": 100,
          "ks": [
            1
          ],
          "momentums": [
            0.5,
            0.6
          ],
          "l_w": [
            0.0005
          ],
          "l_v": [
            0.0005
          ],
          "l_h": [
            0.0005
          ],
          "decay": 0.0002
        }
      ]
    }
  ]
}

This requires the ml-100k dataset in the root of this project inside a folder named "ml-100k"