我确实在Windows 10,x64,32 GB RAM,Core i7 2600k和GTX 1050Ti上设置了系统
当我运行这个python src/interactive_conditional_samples.py
它要求模型提示>>
然后我输入我的单词,如皮卡丘,输出如下。这个输出显然是不正确的和无关的
======================================== SAMPLE 1 ========================================
-the-cat
You can see more of my artworks on my art page.<|endoftext|>(WOMENSUE.COM) – It's been eight weeks since Republican presidential nominee Donald Trump made news with controversial remarks about U.S. Sen. Kirsten Gillibrand (D-N.Y.) , prompting some to question whether Trump was using a moment of national embarrassment to garner votes.
But the question never has come up among women voters. According to a new poll from Morning Consult among more than 800 likely voters, Clinton trails Trump by 11 points among female voters, 44-36. Even if Clinton wins the women over 30 in the survey – 55-28 in favor of Hillary - the margin is still quite narrow at 3 percentage points.
"If you look at the race and you see women's views, it's clear that most women don't see Trump as a guy who is a threat to their future as women. If you are one of the women and you do see Trump as someone who is a threat to women, then he's not a guy worth getting to know," wrote Morning Consult Associate Director of Public Policy Dan Pate during a recent phone interview.
But some female voters do see Trump in that unflattering light. That's because for most women, Trump is the biggest threat to "the future of women's lives," according to a Morning Consult-NBC News poll conducted Dec. 28 to Dec. 29.
For young women, the question of gender is only slightly less divisive. Fifty-one percent of young women between 18 and 29 in the poll said they view Clinton negatively, compared with 59 percent of young women 42 to 48. But a majority (54 percent) also believe Trump is a threat to men.
But while women vote in droves for their two major party candidates, women are still relatively conservative (44 percent of women between 18 and 29 and 53 percent in the other poll). Just 6 percent of young women believe Trump cares about women, while 36 percent believe he doesn't.
And even among those women who do believe Trump cares about women, his approval rating among female voters is about the same as the ratings among millennial men (60 percent positive to 23 percent negative).
This poll of 1,013 female voters was conducted by telephone Nov. 27-30 with a 3.0 percent margin of error; a general-election poll had a 5.0 percent margin of error and a survey conducted in late November by Fox News had
================================================================================
所以我的第一个问题如下
**1)**我如何将input.txt作为输入,这将有几句话,并将输出写入一个文本文件?
interactive_conditional_samples.py
hparams.json
**3)**如何让它在GPU上而不是CPU上工作?
**4)**我可以让它为给定的句子返回更逻辑的输出吗?
1.我怎么能让它运行在GPU上而不是CPU上?我有GTX 1050 Ti,4 GB RAM
下面是我的CMD的完整输入和输出
C:\gpt-2>python src/interactive_conditional_samples.py
WARNING:tensorflow:From C:\Python37\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From C:\gpt-2\src\sample.py:46: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
WARNING:tensorflow:From C:\gpt-2\src\sample.py:48: multinomial (from tensorflow.python.ops.random_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.random.categorical instead.
WARNING:tensorflow:From C:\Python37\lib\site-packages\tensorflow\python\training\saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to check for files with this prefix.
Model prompt >>> Pikachu
======================================== SAMPLE 1 ========================================
-the-cat
You can see more of my artworks on my art page.<|endoftext|>(WOMENSUE.COM) – It's been eight weeks since Republican presidential nominee Donald Trump made news with controversial remarks about U.S. Sen. Kirsten Gillibrand (D-N.Y.) , prompting some to question whether Trump was using a moment of national embarrassment to garner votes.
But the question never has come up among women voters. According to a new poll from Morning Consult among more than 800 likely voters, Clinton trails Trump by 11 points among female voters, 44-36. Even if Clinton wins the women over 30 in the survey – 55-28 in favor of Hillary - the margin is still quite narrow at 3 percentage points.
"If you look at the race and you see women's views, it's clear that most women don't see Trump as a guy who is a threat to their future as women. If you are one of the women and you do see Trump as someone who is a threat to women, then he's not a guy worth getting to know," wrote Morning Consult Associate Director of Public Policy Dan Pate during a recent phone interview.
But some female voters do see Trump in that unflattering light. That's because for most women, Trump is the biggest threat to "the future of women's lives," according to a Morning Consult-NBC News poll conducted Dec. 28 to Dec. 29.
For young women, the question of gender is only slightly less divisive. Fifty-one percent of young women between 18 and 29 in the poll said they view Clinton negatively, compared with 59 percent of young women 42 to 48. But a majority (54 percent) also believe Trump is a threat to men.
But while women vote in droves for their two major party candidates, women are still relatively conservative (44 percent of women between 18 and 29 and 53 percent in the other poll). Just 6 percent of young women believe Trump cares about women, while 36 percent believe he doesn't.
And even among those women who do believe Trump cares about women, his approval rating among female voters is about the same as the ratings among millennial men (60 percent positive to 23 percent negative).
This poll of 1,013 female voters was conducted by telephone Nov. 27-30 with a 3.0 percent margin of error; a general-election poll had a 5.0 percent margin of error and a survey conducted in late November by Fox News had
================================================================================
8条答案
按热度按时间lrpiutwd1#
顺便说一下,我也测试过句子,输出结果很糟糕
即使在我的电脑上也很慢
酷睿i7 2600K@4.5 GHz,32 GB内存
设置
iyfjxgzm2#
6)当我将长度参数更改为1000时,我得到此错误
模型提示>皮卡丘是一种矮矮胖胖的啮齿动物神奇宝贝。它全身覆盖着黄色的皮毛,背上有两条棕色的横条纹。它有一个小嘴巴,长而尖的耳朵,黑色的尖端,棕色的眼睛。每个脸颊都是一个红色的圆圈,里面有一个储存电力的口袋。它有短前臂,每个爪子上有五个手指,每只脚有三个脚趾。 lightning 状的尾巴底部有一片棕色的皮毛。雌性的尾巴末端有一个V形的缺口,看起来像一个心脏的顶部。它被归类为四足动物,但它可以用后腿站立和行走。
回溯(最近的呼叫最后一个):
文件“C:\Python37\lib\site-packages\tensorflow\python\client\session.py”,第1334行,in _do_call
return fn(*args)
文件“C:\Python37\lib\site-packages\tensorflow\python\client\session.py”,第1319行,in _run_fn
选项、feed_dict、fetch_list、target_list、run_metadata)
文件“C:\Python37\lib\site-packages\tensorflow\python\client\session.py”,第1407行,in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError:indices[0,0] = 1024不在[0,1024)中
{{node sample_sequence/while/model/GatherV2_1}}
在处理上述异常的过程中,又出现了一个异常:
回溯(最近的呼叫最后一个):
文件“src/interactive_conditional_samples.py”,第90行,
fire.Fire(interact_model)
File“C:\Python37\lib\site-packages\fire\core.py”,line 127,in Fire
component_trace = _Fire(component,args,context,name)
文件“C:\Python37\lib\site-packages\fire\core.py”,第366行,在_Fire中
component,remaining_args)
文件“C:\Python37\lib\site-packages\fire\core.py”,第542行,在_CallCallable中
结果= fn(*varargs,**kwargs)
文件“src/interactive_conditional_samples.py”,第80行,interact_model
context:[context_tokens for _ in range(batch_size)]
文件“C:\Python37\lib\site-packages\tensorflow\python\client\session.py”,第929行,运行中
run_metadata_ptr)
文件“C:\Python37\lib\site-packages\tensorflow\python\client\session.py”,第1152行,in _run
feed_dict_tensor,options,run_metadata)
文件“C:\Python37\lib\site-packages\tensorflow\python\client\session.py”,第1328行,in _do_run
run_metadata)
文件“C:\Python37\lib\site-packages\tensorflow\python\client\session.py”,第1348行,in _do_call
raise type(e)(node_def,op,message)
tensorflow.python.framework.errors_impl.InvalidArgumentError:indices[0,0] = 1024不在[0,1024)中
node sample_sequence/while/model/GatherV2_1(定义于C:\gpt-2\src\model.py:157)
由操作“sample_sequence/while/model/GatherV2_1”引起,定义于:
文件“src/interactive_conditional_samples.py”,第90行,
fire.Fire(interact_model)
File“C:\Python37\lib\site-packages\fire\core.py”,line 127,in Fire
component_trace = _Fire(component,args,context,name)
文件“C:\Python37\lib\site-packages\fire\core.py”,第366行,在_Fire中
component,remaining_args)
文件“C:\Python37\lib\site-packages\fire\core.py”,第542行,在_CallCallable中
结果= fn(*varargs,**kwargs)
文件“src/interactive_conditional_samples.py”,第64行,interact_model
temperature=温度,top_k=top_k
文件“C:\gpt-2\src\sample.py”,第73行,在sample_sequence中
back_prop=False,
文件“C:\Python37\lib\site-packages\tensorflow\python\ops\control_flow_ops.py”,第3556行,在while_loop中
return_same_structure)
文件“C:\Python37\lib\site-packages\tensorflow\python\ops\control_flow_ops.py”,第3087行,BuildLoop
pred、body、original_loop_vars、loop_vars、shape_invariants)
文件“C:\Python37\lib\site-packages\tensorflow\python\ops\control_flow_ops.py”,第3022行,in _BuildLoop
body_result = body(*packed_vars_for_body)
文件“C:\Python37\lib\site-packages\tensorflow\python\ops\control_flow_ops.py”,第3525行,
body = lambda i,lv:(i + 1,orig_body(*lv))
文件“C:\gpt-2\src\sample.py”,第45行,正文
next_outputs = step(hparams,prev,past=past)
文件“C:\gpt-2\src\sample.py”,第33行,步骤
lm_output = model.model(hparams=hparams,X=tokens,past=past,reuse=tf. token_REUSE)
模型中的文件“C:\gpt-2\src\model.py”,第157行
h = tf.gather(wte,X)+ tf.gather(wpe,positions_for(X,past_length))
文件“C:\Python37\lib\site-packages\tensorflow\python\util\dispatch.py”,第180行,在 Package 器中
return target(*args,**kwargs)
文件“C:\Python37\lib\site-packages\tensorflow\python\ops\array_ops.py”,第3273行,在gather中
return gen_array_ops. axis_v2(params,indices,axis,name=name)
文件“C:\Python37\lib\site-packages\tensorflow\python\ops\gen_array_ops.py”,第4390行,在python v2中
“GatherV2”,params=params,indices=indices,axis=axis,name=name)
文件“C:\Python37\lib\site-packages\tensorflow\python\framework\op_def_library.py”,第788行,in _apply_op_helper
op_def=op_def)
File“C:\Python37\lib\site-packages\tensorflow\python\util\deprecation.py”,line 507,in new_func
return func(*args,**kwargs)
文件“C:\Python37\lib\site-packages\tensorflow\python\framework\ops.py”,第3300行,在create_op中
op_def=op_def)
文件“C:\Python37\lib\site-packages\tensorflow\python\framework\ops.py”,第1801行,在init中
self._traceback = tf_stack.extract_stack()
InvalidArgumentError(参见上面的追溯):indices[0,0] = 1024不在[0,1024]中
node sample_sequence/while/model/GatherV2_1(定义于C:\gpt-2\src\model.py:157)
o75abkj43#
同样的问题(6),如果你有解决方案,现在,请告诉我,谢谢:)
cuxqih214#
1.你需要玩一点python。文件阅读(使用控制字符串拆分,JSON或其他方法)或解析目录中的多个文件。我的首选方式是带web界面的数据库,然而,我不运行自动化。
1.我想不是,但如果你编程自己的功能,那么你可以有更多。再次,我的参数是由数据库控制的。
1.我猜保持完全相同的语法和风格的数据上学到了?然而,正如在开发人员自述,很多还没有理解的人工智能行为(因此研究).
1.安装GPU版本的tensorflow。它是在自述文件中编写的。要获得正确的cudnn和cuda版本,请参考谷歌搜索您愿意安装的tensorflow版本。还有一个指南,将告诉您如何确切地更新PATH变量(在Windows的情况下)。
这是CPU上的速度慢,是的.它需要87秒从单词中生成一批5个样本“突然”,使用最大输出长度可能,在Gefore 1660 6GB:
是每个样本可能的最大长度,因此使用一个令牌,它可以输出多达1023个afaik。如果您想获得1000,则不能使用超过24个令牌作为输入
z9smfwbn5#
@FurkanGozukara我已经为此创建了PR。你可以看看#174
13z8s7eq6#
1050ti?忘了GPU吧。你需要2080ti
luaexgnf7#
嘿,我如何使GPT-2创建其输出到一个指定的文本文件?
i2loujxw8#
下面是我用来连接GPT-2模型的脚本。我让它将文本输出到我的语音合成模块,但是你可以很容易地使用“with file as.”并将变量(下面脚本中的“text”-向下滚动到靠近末尾的while True块)内容写入文件.