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 split() takes at least 3 arguments (2 given) #1

Open
Phoebe-star opened this issue Jul 31, 2017 · 12 comments
Open

error split() takes at least 3 arguments (2 given) #1

Phoebe-star opened this issue Jul 31, 2017 · 12 comments

Comments

@Phoebe-star
Copy link

I run the command
"python run.py --data_dir=your_dataset_path" or
"python run.py --mode=val --data_dir=your_dataset_path"

and have this error

Traceback (most recent call last):
File "run.py", line 183, in
tf.app.run()
File "/home/EN/person_search/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "run.py", line 121, in main
images1, images2 = preprocess(images, is_train)
File "run.py", line 48, in preprocess
return tf.cond(is_train, train, val)
File "/home/EN/person_search/local/lib/python2.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 1776, in cond
orig_res, res_t = context_t.BuildCondBranch(fn1)
File "/home/EN/person_search/local/lib/python2.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 1677, in BuildCondBranch
r = fn()
File "run.py", line 19, in train
split = tf.split(images, [1, 1])
TypeError: split() takes at least 3 arguments (2 given)

@digitalbrain79
Copy link
Owner

Replace "your_dataset_path" to your downloaded dataset path. For example "/tmp/cuhk03".

@Phoebe-star
Copy link
Author

thanks , I solved
but how to do input two images and get the result whether if they are the same or not?

@digitalbrain79
Copy link
Owner

I added test function. Refer to the README.

@Phoebe-star
Copy link
Author

thanks ,
I have another problem
when training , how to know the two input image is the same or not the same person

@digitalbrain79
Copy link
Owner

I make True/False pair from dataset repeatedly. Refer the 'read_data' function in 'cuhk03_dataset.py'.

@Phoebe-star
Copy link
Author

Phoebe-star commented Aug 4, 2017

Does not check the image name when running the run.py ?
like 0000_00.jpg and 0000_01.jpg is the same
0000_01.jpg and 0001_00.jpg is not the same

can it train own data?how to do?
thanks you^^

@digitalbrain79
Copy link
Owner

digitalbrain79 commented Aug 6, 2017

Maybe false prediction. Accuracy is not 100% :)

I used CUHK03 dataset. It is composed of mat files.
If your dataset is different format, you should make your own dataset.py.

@Phoebe-star
Copy link
Author

I have some questions?

  1. in the cuhk03_dataset.py , line 79 and line80 ( labels.append([1., 0.]) labels.append([0., 1.]) )
    Q: what is doing??

  2. in the cuhk03_dataset.py , line90 ( return np.transpose(batch_images, (1, 0, 2, 3, 4)) )
    Q:why is 1,0,2,3,4 instead of 0,1,2,3,4

3.in the run.py line 84 and line85 reshape = tf.reshape(concat, [shape[2], shape[3], shape[0], shape[1], 5, 5]) g = tf.transpose(reshape, [2, 3, 0, 1, 4, 5])
Q: why is 2 ,3, 0 , 1 and 2,3,0,1,4,5

4.do yo have any idea for the thing ?
the thing is when training , I use the reverse picture (the person head is button, the person leg is top)
it will happen?

and if I train the picture that the WIDTH is longer than HEIGHT
can it train?

thank you very much

@sde123
Copy link

sde123 commented Sep 12, 2017

@thomaspark-pkj
hello,
I have run like this:python run.py --data_dir=/home/dai/code/person_reidentification/5/cuhk03_release
but I still got a problem that :TypeError: split() takes at least 3 arguments (3 given).
Could you please tell me how to solve it?

@sde123
Copy link

sde123 commented Sep 13, 2017

@thomaspark-pkj
hello
I solved the problem,and run the code.
But I also want to show the feature like the visualization of feature in the paper,I run the code and find the feature in the conv layers or other layers is four dimensions (1,37,12,25) that is not the three dimensions that is RGB,so I cannot get the result with the color like the visualization of feature as shown in your paper.
Could you please tell me what is wrong?
Thankyou verymuch

@jsdakss
Copy link

jsdakss commented Jun 5, 2018

@sde123 hello,
I have ran: python run.py and got the same problem: TypeError: split() takes at least 3 arguments (3 given).
I wonder how did you solve it? ths!

@swimmer2020
Copy link

My code:
##replacing the old high score with their new high score##
filedata = database.read()
database.close()
newdata=filedata.replace(userStuff[0]+" "+userStuff[1]+" "+userStuff[2]+userStuff[0]+" "+userStuff[1]+" "+str(player1score))
database=open("usernames","w")
database.write(newdata)

it came up with this error:
TypeError: replace() takes at least 3 arguments (2 given)

I am doing it in trinket and wondered how to fix it

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