apple / turicreate

Turi Create simplifies the development of custom machine learning models.
BSD 3-Clause "New" or "Revised" License
11.19k stars 1.14k forks source link

SFRAME problem and turicreate #3457

Closed arashsa2022 closed 2 years ago

arashsa2022 commented 2 years ago

Hello I'm using turicreate as bellow but I got the errors as bellow also

transaction_data = '../notebooks/blocks_0_10000/'

if os.path.exists('../notebooks/blocks_0_10000'): sf = gl.SFrame(transaction_data)

TAKE SAMPLE

s = sf.sample(0.22, seed=1)
df = s.to_dataframe()
df = df[df['input_address'].notnull()]
df = df[df['output_address'].notnull()]
df = df.fillna(0)
sf_transactions = gl.SFrame(df)
g = gl.SGraph().add_edges(sf_transactions, src_field='input_address', dst_field='output_address')
print(len(sf))    
print(len(df))
print(g)

else: print('cant find data')

ERROR: OSError Traceback (most recent call last) File ~/anaconda3/envs/py38/lib/python3.8/site-packages/turicreate/data_structures/sframe.py:834, in SFrame.init(self, data, format, _proxy) 833 url = _make_internal_url(data) --> 834 self.proxy.load_from_sframe_index(url) 835 elif _format == "empty":

File cy_sframe.pyx:77, in turicreate._cython.cy_sframe.UnitySFrameProxy.load_from_sframe_index()

File cy_sframe.pyx:80, in turicreate._cython.cy_sframe.UnitySFrameProxy.load_from_sframe_index()

OSError: Cannot open /home/aa/Downloads/thesis-bitcoin-clustering-master/notebooks/blocks_0_10000/dir_archive.ini for read. Cannot open /home/aa/Downloads/thesis-bitcoin-clustering-master/notebooks/blocks_0_10000/dir_archive.ini for reading

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last) Input In [11], in <cell line: 5>() 3 transaction_data = '../notebooks/blocks_0_10000/' 5 if os.path.exists('../notebooks/blocks_0_10000'): ----> 6 sf = gl.SFrame(transaction_data) 7 # TAKE SAMPLE 8 s = sf.sample(0.22, seed=1)

File ~/anaconda3/envs/py38/lib/python3.8/site-packages/turicreate/data_structures/sframe.py:838, in SFrame.init(self, data, format, _proxy) 836 pass 837 else: --> 838 raise ValueError("Unknown input type: " + format)

File ~/anaconda3/envs/py38/lib/python3.8/site-packages/turicreate/_cython/context.py:50, in debug_trace.exit(self, exc_type, exc_value, traceback) 47 if exc_type: 48 if not self.show_cython_trace: 49 # To hide cython trace, we re-raise from here ---> 50 raise exc_type(exc_value) 51 else: 52 # To show the full trace, we do nothing and let exception propagate 53 54 # In verbose mode we print the server log 55 if self.show_server_log:

OSError: Cannot open /home/aa/Downloads/thesis-bitcoin-clustering-master/notebooks/blocks_0_10000/dir_archive.ini for read. Cannot open /home/aa/Downloads/thesis-bitcoin-clustering-master/notebooks/blocks_0_10000/dir_archive.ini for reading

TobyRoseman commented 2 years ago

What is the contents of /home/aa/Downloads/thesis-bitcoin-clustering-master/notebooks/blocks_0_10000? Looks like it's not an SFrame.

arashsa2022 commented 2 years ago

Thanks for your response the blocks_0_10000 is a folder that contains below files which is the output of the (https://github.com/behas/bitcoingraph) output of this script : bcgraph-export 0 1000 -u your_rpcuser -p your_rpcpass

addresses.csv: sorted list of Bitcoin addressed addresses_header.csv blocks.csv: list of blocks (hash, height, timestamp) blocks_header.csv transactions.csv: list of transactions (hash, coinbase/non-coinbase) outputs.csv: list of transaction outputs (output key, id, value, script type) rel_block_tx.csv: relationship between blocks and transactions (block_hash, tx_hash) rel_input.csv: relationship between transactions and transaction outputs (tx_hash, output key) rel_output_address.csv: relationship between outputs and addresses (output key, address) rel_tx_output.csv: relationship between transactions and transaction outputs (tx_hash, output key)

TobyRoseman commented 2 years ago

Take a look at the API for SFrame. You can pass a single csv file to SFrame(...) but you can't pass a directory of csv files.