-
Notifications
You must be signed in to change notification settings - Fork 13
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
TypeError: '>' not supported between instances of 'str' and 'int' #5
Comments
Hi @PeterouZh, I think the reason might be that f3 parse "-1" as string instead of int. Can you try to replace that line with f3 = self.frame.replace(-1, 0) or f3 = self.frame.replace("-1", 0)? Please let me know whether it works or not. |
Hi @yingcong , I'm facing the same problem, and I tried your method to solve it. But after change that line, it keeps run time error at the start of training(showing "stack overflow")
I'm using pytorch 1.0.1 with cuda 9.1, other modules are installed as requirement.txt |
Hi @oscardhc It seems that images are not successfully loaded with getitem. Have you checked if the celeba images (jpg format) are in the ../celebra-dataset file? If yes, could you remove the "try -- except" block in the getitem method? This could give more information about why images cannot be loaded. |
@yingcong Thank you for the advice! It turns out that I've put all images in a subdirectory in the dataset path(as the default result of unzipping). After moving the images, your solutions above work and it starts to train. |
I fix this issue by replacing "f3 = self.frame.iloc[:, 1:] > 0" url with "f3 = self.frame.iloc[:, 3:-1] > 0". |
Hi @PeterouZh I've replaced f3 = self.frame.iloc[:, 1:] > 0 with f3 = self.frame.replace(-1, 0) in the later commit, which seems more general for different pandas versions. |
I encountered this error when I tried to execute the training script. The line of code that caused the exception is seen here url. I am looking forward to your help.
Below is the detailed error message:
/home/shhs/anaconda3/envs/torch_1_0_py3_6/bin/python /home.bak/shhs/soft/pycharm-2019.1.1/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 46783 --file /media/shhs/Peterou2/user/code/HomoInterpGAN/run.py attribute_manipulation -bs 8 -gpu 0
pydev debugger: process 6843 is connecting
Connected to pydev debugger (build 191.6605.12)
loading default VGG
Traceback (most recent call last):
File "/home.bak/shhs/soft/pycharm-2019.1.1/helpers/pydev/pydevd.py", line 1741, in
main()
File "/home.bak/shhs/soft/pycharm-2019.1.1/helpers/pydev/pydevd.py", line 1735, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/home.bak/shhs/soft/pycharm-2019.1.1/helpers/pydev/pydevd.py", line 1135, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home.bak/shhs/soft/pycharm-2019.1.1/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/media/shhs/Peterou2/user/code/HomoInterpGAN/run.py", line 205, in
engine.run()
File "/media/shhs/Peterou2/user/code/HomoInterpGAN/run.py", line 200, in run
exec ('self.{}()'.format(self.args.command))
File "", line 1, in
File "/media/shhs/Peterou2/user/code/HomoInterpGAN/run.py", line 161, in attribute_manipulation
_, test_dataset = self.load_dataset()
File "/media/shhs/Peterou2/user/code/HomoInterpGAN/run.py", line 106, in load_dataset
csv_path='info/celeba-with-orientation.csv')
File "/media/shhs/Peterou2/user/code/HomoInterpGAN/data/attributeDataset.py", line 220, in init
f3 = self.frame.iloc[:, 1:] > 0
File "/home/shhs/anaconda3/envs/torch_1_0_py3_6/lib/python3.6/site-packages/pandas/core/ops.py", line 2108, in f
res = self._combine_const(other, func)
File "/home/shhs/anaconda3/envs/torch_1_0_py3_6/lib/python3.6/site-packages/pandas/core/frame.py", line 5120, in _combine_const
return ops.dispatch_to_series(self, other, func)
File "/home/shhs/anaconda3/envs/torch_1_0_py3_6/lib/python3.6/site-packages/pandas/core/ops.py", line 1157, in dispatch_to_series
new_data = expressions.evaluate(column_op, str_rep, left, right)
File "/home/shhs/anaconda3/envs/torch_1_0_py3_6/lib/python3.6/site-packages/pandas/core/computation/expressions.py", line 208, in evaluate
return _evaluate(op, op_str, a, b, **eval_kwargs)
File "/home/shhs/anaconda3/envs/torch_1_0_py3_6/lib/python3.6/site-packages/pandas/core/computation/expressions.py", line 68, in _evaluate_standard
return op(a, b)
File "/home/shhs/anaconda3/envs/torch_1_0_py3_6/lib/python3.6/site-packages/pandas/core/ops.py", line 1128, in column_op
for i in range(len(a.columns))}
File "/home/shhs/anaconda3/envs/torch_1_0_py3_6/lib/python3.6/site-packages/pandas/core/ops.py", line 1128, in
for i in range(len(a.columns))}
File "/home/shhs/anaconda3/envs/torch_1_0_py3_6/lib/python3.6/site-packages/pandas/core/ops.py", line 1766, in wrapper
res = na_op(values, other)
File "/home/shhs/anaconda3/envs/torch_1_0_py3_6/lib/python3.6/site-packages/pandas/core/ops.py", line 1625, in na_op
result = _comp_method_OBJECT_ARRAY(op, x, y)
File "/home/shhs/anaconda3/envs/torch_1_0_py3_6/lib/python3.6/site-packages/pandas/core/ops.py", line 1603, in _comp_method_OBJECT_ARRAY
result = libops.scalar_compare(x, y, op)
File "pandas/_libs/ops.pyx", line 97, in pandas._libs.ops.scalar_compare
TypeError: '>' not supported between instances of 'str' and 'int'
The text was updated successfully, but these errors were encountered: