Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running the fraud_detection.py file #5

Closed
sidsidsidsid opened this issue Sep 29, 2019 · 9 comments
Closed

Error running the fraud_detection.py file #5

sidsidsidsid opened this issue Sep 29, 2019 · 9 comments
Assignees

Comments

@sidsidsidsid
Copy link

There is a similar codebase located in the below GIT link. People are leaving issues and someone mentioned the code was "leverage/stolen." Is this repo the correct location to ask questions and/or issues for the codebase? Should people move/copy their issues to this location? Any clarification would be appreciated? Thanks.

******similar codebase location:
https://github.com/llSourcell/The-Neural-Qubit/issues

@josh146
Copy link
Member

josh146 commented Sep 29, 2019

Hi @sidsidsidsid, this is the correct place to ask questions regarding the quantum neural network fraud detection code. The code in this repository is used to generate the results shown in our paper "Continuous-variable quantum neural networks".

@sidsidsidsid
Copy link
Author

Ok thanks.

I'm getting an error when running the fraud_detection.py file

**Env:

  1. Colab
  2. !pip install strawberryfields==0.10.0 tensorflow==1.6.0

**************** ERROR*********************************
Traceback (most recent call last):
File "fraud_detection.py", line 194, in
prog = sf.Program(mode_number)
AttributeError: module 'strawberryfields' has no attribute 'Program'

@co9olguy
Copy link
Member

Hi @sidsidsidsid, you'll have to update to the latest version of Strawberry Fields (0.11). The current state of this repo has recently been updated to be compatible with that version (unfortunately, not backwards-compatible)

@co9olguy
Copy link
Member

Note that you'll have to make sure your environment is also compatible with tensorflow 1.3

@josh146 josh146 changed the title llSourcell/The-Neural-Qubit who is owner or supporter of this code Error running the fraud_detection.py file Oct 3, 2019
@sidsidsidsid
Copy link
Author

The settings changes worked. thanks.

Another issue. Colab times-out before the training is completed. Sometimes it goes beyond 13 hours. So I reduce the below "reps", tb_reps", and savr_reps" variables.

Has anybody ever attempted to run the code on Colab? Is there something I'm doing wrong?

ENV:**
Colab
!pip install strawberryfields==0.11.0 tensorflow==1.3.0
set to GPU

VARIABLE CHANGED**********************
reps = 1000 ##############################30000
tb_reps = 10 ######################################100
savr_reps = 100 ##################################1000

ERROR***
2019-10-03 17:34:35.174945: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2019-10-03 17:34:35.175022: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2019-10-03 17:34:35.175051: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2019-10-03 17:34:35.175068: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2019-10-03 17:34:35.175078: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.

@co9olguy
Copy link
Member

co9olguy commented Oct 4, 2019

@trbromley any advice here?

@trbromley
Copy link
Contributor

Hey @sidsidsidsid, it definitely takes a bit of compute power for training - to put into context we trained for a few hours running on 20 cores + 2 GPUs.

You'll probably want at least 10,000+ for the reps value to get a decent quality of training. The best way to see how training is progressing is to view on TensorBoard.

The tb_reps and savr_reps are how often the code outputs to TensorBoard and how often it saves the model. Making these values too small will slow things down because more time will be spent outputting rather than in training.

We've never run the script on Colab, so you'd have to get into contact with them for support. One question, the errors you give - are you sure that they are not just warnings and that the code is still running?

@co9olguy
Copy link
Member

co9olguy commented Oct 4, 2019

@trbromley those errors are common from that version of TensorFlow. No cause for concern that the model is not training

@sudoankit
Copy link

@sidsidsidsid Those are just warnings as explained in this comment at the official tensorflow repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants